placeholder

HTML5 like placeholder

蓝咒 提交于 2019-11-29 08:45:05
问题 Is there a plugin or built-in functionality for CKEditor 4.x that would act like HTML5 input/textarea placeholder? Only thing I found is http://ckeditor.com/addon/placeholder, but that seems to be something a lot different. 回答1: You can use the configHelper plugin. Demo: http://alfonsoml.blogspot.com.es/2012/04/placeholder-text-in-ckeditor.html 来源: https://stackoverflow.com/questions/16558310/html5-like-placeholder

HTML <input> placeholder 属性

吃可爱长大的小学妹 提交于 2019-11-29 08:17:35
css ::-webkit-input-placeholder { /* WebKit, Blink, Edge */ color: #909; } :-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color: #909; opacity: 1; } ::-moz-placeholder { /* Mozilla Firefox 19+ */ color: #909; opacity: 1; } :-ms-input-placeholder { /* Internet Explorer 10-11 */ color: #909; } HTML input placeholder支持的属性 font properties color background properties word-spacing letter-spacing text-decoration vertical-align text-transform line-height text-indent opacity 来源: https://www.cnblogs.com/qiqi715/p/11493078.html

Bootstrap 表单

北城余情 提交于 2019-11-29 07:03:16
在本章中,我们将学习如何使用 Bootstrap 创建表单。Bootstrap 通过一些简单的 HTML 标记和扩展的类即可创建出不同样式的表单。 表单布局 Bootstrap 提供了下列类型的表单布局: 垂直表单(默认) 内联表单 水平表单 垂直或基本表单 基本的表单结构是 Bootstrap 自带的,个别的表单控件自动接收一些全局样式。下面列出了创建基本表单的步骤: 向父 <form> 元素添加 role="form" 。 把标签和控件放在一个带有 class .form-group 的 <div> 中。这是获取最佳间距所必需的。 向所有的文本元素 <input>、<textarea> 和 <select> 添加 class .form-control 。 <!DOCTYPE html> <html> <head> <title>Bootstrap 实例 - 基本表单</title> <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <script src="/scripts/jquery.min.js"></script> <script src="/bootstrap/js/bootstrap.min.js"></script> </head> <body> <form role="form">

Changing font-family for placeholder

假装没事ソ 提交于 2019-11-29 06:36:01
问题 Is it posible for input field to have one font-family and it's placeholder other? I have tried to change font-family for input's placeholder with already defined @font-face in CSS but it's not working CSS .mainLoginInput::-webkit-input-placeholder { font-family: 'myFont', Arial, Helvetica, sans-serif; } .mainLoginInput:-moz-placeholder { font-family: 'myFont', Arial, Helvetica, sans-serif; } HTML <input class="mainLoginInput" type="text" placeholder="Username" /> How can I slove this problem?

Removing input placeholder on a printable version of an html page

元气小坏坏 提交于 2019-11-29 05:46:32
I have a form with input fields. Each input field has a placeholder attribute. There is also a link displaying the printable version of the same form. My problem is that if I leave the placeholder attribute unchanged and the input field is empty, then the placeholder is actually printed, which is not very good. I am looking for a way to resolve this unfortunate behavior. Right now, the only thing I can think of is traverse the DOM in javascript and remove all the placeholder attributes when the printable version is given. Of course, when reverting back to the normal page view, the placeholder

jQuery实现图片延迟加载

北战南征 提交于 2019-11-29 05:30:20
在浏览有些网站时,发现图片是在下拉滚动条时才加载,这是一个很不错的用户体验。这一效果是通过JavaScript 编写的 jQuery 插件实现的,它可以延迟加载长页面中的图片. 在浏览器可视区域外的图片不会被载入, 直到用户将页面滚动到它们所在的位置. 这与图片预加载的处理方式正好是相反的.在包含很多大图片长页面中延迟加载图片可以加快页面加载速度. 浏览器将会在加载可见图片之后即进入就绪状态. 在某些情况下还可以帮助降低服务器负担. 有些WordPress主题也具备了此功能。 目前我用的这个热点新闻主题由于有缩略图功能所以也试着加上看看效果如何。这里把这一功能应用到WordPress主题方法说一下,其实很简单,首先 下载jquery.lazyloa.js ,放到主题目录中,然后在header.php模板文件</head>标签前添加如下代码: <script type= "text/javascript" src= "<?php bloginfo('template_directory');?>/js/jquery.lazyload.js"></script> <script type="text/javascript"> $(function() { $("img").lazyload({ effect : "fadeIn" }); }); </script>

低版本IE浏览器不兼容placeholder解决方法

北战南征 提交于 2019-11-29 04:10:47
虽说现在很多网站都放弃了IE浏览器的低版本,但是很多时候咱们还得看甲方的要求就制作网站。如果甲方要求兼容IE789,那么咱们就得给人家做出来兼容的产品。 今天就IE789的input标签的placeholder说一说解决方法。 一、优雅降级解决(极力推荐) 也就是俗称的不解决细节,只要大体能满足浏览的要求就可以,placeholder低版本不显示,那么咱们就不在去做兼容方法,反正以后的几年IE低版本的浏览器会被淘汰。 二、使用input的value制作placeholder的效果 这个是我以前用的一个方法,当input有光标的时候删除value的值,光标离开的时候再去查看内容,如果是空或者是跟原来的值一样的就显示value,具体代码如下。 <input type="text" value="我是一个input"/>(www.gendan5.com) <script type="text/javascript"> $(function(){ $('input').each(function(){ $(this).attr('data-value',$(this).val()) }) $('input').on('focus input',function(){ var values = $(this).val(); var valued = $(this).data('value')

updating “placeholder” attribute using knockout

▼魔方 西西 提交于 2019-11-29 01:54:47
问题 I have a form with some fields getting some data using knockout.js (ver. 2.1.0). For example, to update the "value" field of an input I put: <input type="text" name="contrasena" id="login-user" value="" placeholder="" data-bind="value: user"> I have a JSON to store the value a I want to use for "pass" keyword, and it works correctly. I tried to set "placeholder" attribute using the same method, but it doesn't works: <input type="text" name="contrasena" id="login-user" placeholder="" data-bind

TensorFlow 模型的保存与载入

a 夏天 提交于 2019-11-29 01:53:55
参考学习博客: # https://www.cnblogs.com/felixwang2/p/9190692.html一、模型保存 1 # https://www.cnblogs.com/felixwang2/p/9190692.html 2 # TensorFlow(十三):模型的保存与载入 3 4 import tensorflow as tf 5 from tensorflow.examples.tutorials.mnist import input_data 6 7 # 载入数据集 8 mnist = input_data.read_data_sets("MNIST_data", one_hot=True) 9 10 # 每个批次100张照片 11 batch_size = 100 12 # 计算一共有多少个批次 13 n_batch = mnist.train.num_examples // batch_size 14 15 # 定义两个placeholder 16 x = tf.placeholder(tf.float32, [None, 784]) 17 y = tf.placeholder(tf.float32, [None, 10]) 18 19 # 创建一个简单的神经网络,输入层784个神经元,输出层10个神经元 20 W = tf.Variable(tf

Changing the “placeholder” attribute of HTML5 input elements dynamically using Javascript

穿精又带淫゛_ 提交于 2019-11-29 00:59:19
I'm trying to dynamically update the HTML5 placeholder attribute of a text field using jQuery. $("textarea").attr("placeholder", "New placeholder text"); From Firebug, I can observe that the placeholder attribute is indeed changing. But in the rendered textarea element, it stays the same. Any suggestions? If you are using Firebug I can assume you are using Firefox, and Firefox doesn't yet support placeholder attribute in the input fields itself. Placeholder feature detection I just tried on Chrome for Mac and it supports placeholder text on textareas (and changes via javascript) 2015 Update: