placeholder

IE9 HTML5 placeholder - how are people achieving this?

主宰稳场 提交于 2019-12-30 09:26:30
问题 I'm trying to use the placeholder="xxx" attribute in my web application, and I don't want to have a special visual for IE9. Can people throw out some good suggestions for achieving this functionality in IE9? I've found a couple links on here but none of the suggested scripts were sufficient... and the answers were from mid-2011, so I figured maybe there is a better solution out there. Perhaps with a widely-adopted jQuery plugin? I do not want to use anything that requires intrusive code such

asp.net mvc How to add placeholder for html.dropdownlist

牧云@^-^@ 提交于 2019-12-30 04:04:05
问题 I'm using asp.net mvc 3. I have this dropdownlist of countries and I want to add a placeholder for it. Here's my code: @Html.DropDownList("country", new SelectList(ViewBag.countries as System.Collections.IEnumerable, "name", "name"), new { @class="chzn-select", @placeholder="-select-", @style="width:160px;" } ) But the placeholder doesn't work, while the style works. How do I set a placeholder for this? PS. I just want to use @Html.DropDownList , not @Html.DropDownListFor 回答1: In your

如何为“选择”框创建占位符?

二次信任 提交于 2019-12-30 02:56:33
我正在使用占位符进行文本输入,效果很好。 但是我也想为我的选择框使用一个占位符。 当然,我可以使用以下代码: <select> <option value="">Select your option</option> <option value="hurr">Durr</option> </select> 但是“选择您的选项”是黑色而不是浅灰色。 因此,我的解决方案可能基于 CSS 。 jQuery也很好。 这只会使下拉菜单中的选项变为灰色(因此,单击箭头后): option:first { color: #999; } 问题是:人们如何在选择框中创建占位符? 但它已经得到回答,欢呼。 使用此方法会导致所选值始终为灰色(即使在选择实选项后): select { color: #999; } #1楼 下面的解决方案也可以在Firefox中运行,无需任何JavaScript: option[default] { display: none; } <select> <option value="" default selected>Select Your Age</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4"

02 表单

久未见 提交于 2019-12-30 00:24:28
//基础表单 <form role="form" >   <div class="form-group" >     <label for="exampleInputEmail1">邮箱:</label>     <input type="email" class="form-control" id="exampleInputEmail1" placeholder="请输入您的邮箱地址" >   </div>   <div class="form-group" >     <label for="exampleInputPassword1">密码</label>     <input type="password" class="form-control" id="exampleInputPassword1" placeholder="请输入您的邮箱密码" >   </div>   <div class="checkbox">     <label>       <input type="checkbox"> 记住密码     </label>   </div>   <button type="submit" class="btn btn-default" >进入邮箱</button> </form> 显示结果如下: //水平表单 添加类名 form-horizontal

CSS :after input placeholder not working in mozilla

限于喜欢 提交于 2019-12-29 09:16:07
问题 I want to put a small icon in my text input placeholder right where my placeholder text ends <input type="text" placeholder="Search "> With CSS I want to add a magnifier icon. This works perfectly in Chrome, but I want to make it work for Firefox as well. For Chrome I used ::-webkit-input-placeholder:after{content:url('magnifier.jpg');} And with Firefox I've tried input:-moz-placeholder:after{content:url('magnifier.jpg');} and input:-moz-placeholder::after{content:url('magnifier.jpg');} but

How to keep input placeholder visible when user is typing

五迷三道 提交于 2019-12-29 08:54:28
问题 I have a new and intriguing requirement. Instead of the placeholder disappearing when the user starts typing, it should remain visible and shift over to the right hand side of the input box. Is this even possible with a standard HTML placeholder? How might I achieve this? Thanks 回答1: I don't think that you can do it ONLY with standard placeholders, but you can use this example http://css-plus.com/2011/09/make-the-input-placeholder-user-friendly/ 回答2: I am not sure if keeping placeholder

Dropout 解决 overfitting

﹥>﹥吖頭↗ 提交于 2019-12-26 10:12:03
声明 来源于莫烦Python: Dropout 解决 overfitting 往期回顾 过拟合 (Overfitting)及其解决方法 栗子    图中黑色曲线是正常模型,绿色曲线就是overfitting模型。尽管绿色曲线很精确的区分了所有的训练数据,但是并没有描述数据的整体特征,对新测试数据的适应性较差。    第三条曲线存在overfitting问题,尽管它经过了所有的训练点,但是不能很好的反应数据的趋势,预测能力严重不足。 TensorFlow提供了强大的dropout方法来解决overfitting问题。 代码 import tensorflow as tf from sklearn . datasets import load_digits from sklearn . model_selection import train_test_split from sklearn . preprocessing import LabelBinarizer # load data digits = load_digits ( ) X = digits . data y = digits . target y = LabelBinarizer ( ) . fit_transform ( y ) X_train , X_test , y_train , y_test = train

深入理解JVM - JVM内存模型

不羁的心 提交于 2019-12-25 23:00:54
各版本的差异 JDK1.6 在JDK1.6 的时候运行时常量池在方法区中 JDK1.7 在JDK1.7 的时候运行时常量池在堆中 JDK1.8 在JDK1.8 的时候,JVM内存模型直接将方法区移到了本地内存中,叫元数据空间。该区域的内存大小就只受本机总内存的限制,但是当申请不到足够内存时也会报出 程序计数器 主要作用是:存储当前线程运行时的字节码行号,占用空间小且线程私有。 字节码解释器会通过改变程序计数器的值来选取下一条需要执行的字节码指令,并且分支(if)、循环、跳转、异常处理、线程恢复等基础功能都是基于程序计数器来实现的。 此内存区域是唯一一个在Java虚拟机规范中没有规定任何OutOfMemoryError情况的区域。 JAVA 虚拟机栈 线程私有,描述的是Java方法执行的内存模型,主要作用是:存储运行当前线程需要执行的所有方法所对应的栈帧。 一个线程栈的默认大小是1M,可用参数 –Xss调整大小,例如-Xss256k; 栈帧 栈帧(Stack Frame)是用于支持虚拟机进行方法调用和方法执行的数据结构,它是Java 虚拟机栈(Virtual Machine Stack)的栈元素。 每个方法在执行的同时都会创建一个栈帧(Stack Frame)用于存储局部变量表、操作数栈、动态链接、方法出口等信息。 每一个方法的执行过程,就是一个栈帧在虚拟机栈中从入栈到出栈的过程。

placeholder兼容ie8

隐身守侯 提交于 2019-12-25 20:17:55
<script type= "text/javascript" > if ( !( 'placeholder' in document.createElement( 'input' )) ){ $( 'input[placeholder],textarea[placeholder]' ).each( function (){ var that = $( this ), text= that.attr( 'placeholder' ); if (that.val()=== "" ){ that.val(text).addClass( 'placeholder' ); } that.focus( function (){ if (that.val()===text){ that.val( "" ).removeClass( 'placeholder' ); } }) .blur( function (){ if (that.val()=== "" ){ that.val(text).addClass( 'placeholder' ); } }) .closest( 'form' ).submit( function (){ if (that.val() === text){ that.val( '' ); } }); }); } </script> 来源: https://www

Tensorflow: introducing a matrix of different size in a placeholder

雨燕双飞 提交于 2019-12-25 07:35:26
问题 I'm trying to do a simple operation with tensorflow of matrix multiplication but I have to use a matrix of variable size of its columns (as it can be seen in the example below) import tensorflow as tf input1 = tf.placeholder("float", [None,None]) input2 = tf.placeholder(tf.float32) output = tf.mul(input1, input2) with tf.Session() as sess: print(sess.run([output], feed_dict={input1:[[1,2],[3,4,5]], input2:[2.]})) The thing is that once I do this, I receive an error message telling me: