placeholder

jQuery插件placeholder的使用方法

谁都会走 提交于 2019-12-21 03:31:15
借助该插件可以轻松实现HTML5中placeholder特效: 实例代码如下: <script type="text/javascript" src="<%=basePath%>js/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="<%=basePath%>js/jquery.placeholder.js"></script> <script type="text/javascript"> $(function() { $('input, textarea').placeholder(); }); </script> <style type="text/css"> input, textarea { font-family: Helvetica, Arial; color: #000;} .placeholder {color: #aaa;} </style> </head> <input type="text" id="userName" name="userName" placeholder="请输入用户名…" style="margin-bottom: 12px;"><br> <input type="password" id="password" name="password"

input 的 placeholder属性在IE8下的兼容处理

萝らか妹 提交于 2019-12-21 03:30:53
placeholder是input标签的新属性,在使用的时候有两个问题: 1、IE8 下不兼容 处理思路: 如果浏览器不识别placeholder属性,给input添加类名placeholder,模仿placeholder属性的样式,并给input 的value赋值placeholder属性的值 2、 input的type属性是password的情况,用上面的方法处理提示语为密码文 处理思路: 新添加一个标签,模仿placeholder属性 直接上代码: css部分: 1 .input-item { 2 position: relative; 3 margin: 10px; 4 } 5 .pwd-place { 6 position: absolute; 7 top: 0; 8 left: 72px; 9 width: 100%; 10 height: 100%; 11 font-size: 12px; 12 } html部分: 1 <form action="#"> 2 <div class="input-item"> 3 <label for="userName">用户名:</label> 4 <input class="username" id="userName" type="text" placeholder="请输入用户名"> 5 </div> 6 <div class

IE不支持HTML5表单属性placeholder的解决办法

放肆的年华 提交于 2019-12-21 03:22:51
1. [代码][JavaScript]代码 (function ($) { $.fn.placeholder = function (options) { var defaults = { pColor: "#ccc", pActive: "#999", pFont: "14px", activeBorder: "#080", posL: 8, zIndex: "99" }, opts = $.extend(defaults, options); // return this.each(function () { if ("placeholder" in document.createElement("input")) return; $(this).parent().css("position", "relative"); var isIE = $.browser.msie, version = $.browser.version; //不支持placeholder的浏览器 var $this = $(this), msg = $this.attr("placeholder"), iH = $this.outerHeight(), iW = $this.outerWidth(), iX = $this.position().left, iY = $this.position()

【jquery】基于 jquery 实现 ie 浏览器兼容 placeholder 效果

岁酱吖の 提交于 2019-12-21 03:22:23
placeholder 是 html5 新增加的属性,主要提供一种提示(hint),用于描述输入域所期待的值。该提示会在输入字段为空时显示,并会在字段获得焦点时消失。placeholder 属性适用于以下类型的 input 标签:text, search, url, telephone, email 以及 password。 我们先看下在谷歌浏览器中的效果,如图所示: 获得焦点时: 输入字段: 因为是 html5 属性,自然低版本的浏览器比如 ie6-8 不兼容。下面就介绍下如何在低版本浏览器中显示以上效果,话不多说直接上代码。 html: <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> <meta name="renderer" content="webkit"/> <meta name="keywords" content=""/> <meta name="description" content=""/> <title>基于 jquery 实现 ie 浏览器兼容 placeholder 效果</title> <style> *{margin:0;padding:0;}

【jquery】基于 jquery 实现 ie 浏览器兼容 placeholder 效果

两盒软妹~` 提交于 2019-12-21 03:21:08
原文链接: http://www.cnblogs.com/yjzhu/p/4398835.html placeholder 是 html5 新增加的属性,主要提供一种提示(hint),用于描述输入域所期待的值。该提示会在输入字段为空时显示,并会在字段获得焦点时消失。placeholder 属性适用于以下类型的 input 标签:text, search, url, telephone, email 以及 password。 我们先看下在谷歌浏览器中的效果,如图所示: 获得焦点时: 输入字段: 因为是 html5 属性,自然低版本的浏览器比如 ie6-8 不兼容。下面就介绍下如何在低版本浏览器中显示以上效果,话不多说直接上代码。 html: <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> <meta name="renderer" content="webkit"/> <meta name="keywords" content=""/> <meta name="description" content=""/> <title>基于 jquery 实现 ie 浏览器兼容

Styling part of the text in the placeholder

狂风中的少年 提交于 2019-12-20 06:02:07
问题 I would like to modify the css style of a part of placeholder . Attention not all the placeholder . If my placeholder is: "Where (example: New York)" <label>Search:</label> <textarea placeholder="Where (example: New York)" required="required"> </textarea> Can i set as italic only (example: New York) ? For all the placeholder look here 回答1: You may want to think about what the role and meaning of placeholders is. Most UI experts agree: placeholders are not labels. Labels (like "Search") are

DBD::CSV and placeholders

不问归期 提交于 2019-12-20 02:34:25
问题 #!/usr/bin/env perl use warnings; use strict; use DBI; my $dbh = DBI->connect( "DBI:CSV:", '', '', { RaiseError => 1 } ) or die DBI->errstr; my $table = 'my_test_table_1.csv'; $dbh->do( "CREATE TEMP TABLE $table( id INTEGER, name CHAR(64) )" ); my $sth = $dbh->prepare( "INSERT INTO $table ( id, name ) VALUES( ?, ? )" ); $sth->execute( 1, 'Ruth' ); $sth->execute( 2, 'John' ); $sth->execute( 3, 'Nena' ); $sth->execute( 4, 'Mark' ); $sth = $dbh->prepare( "SELECT * FROM $table WHERE id > ? LIMIT

jQuery Mobile 1.1.1 Custom Select Menu - Placeholder Text not Visible

泪湿孤枕 提交于 2019-12-19 18:23:54
问题 After upgrading to jQuery Mobile 1.1.1 earlier today (7/13/2012) I noticed that all of my Custom Select menus no longer show the placeholder text on page load. Is there something I need to do differently in 1.1.1 to show the placeholder text in custom select menus? Help!?!? Here's a sample of my code: <div data-role="fieldcontain" class="ui-hide-label no-field-separator"> <label for="ceiling" class="select" data-theme="a">Ceiling</label> <select name="ceiling" id="ceiling" data-theme="a" data

Is it possible to have a 'permanent' placeholder?

三世轮回 提交于 2019-12-19 03:39:26
问题 I am working on a system which includes some textboxes which measure things like temperature, heart rates beats per minute etc. Right now I just use a textbox and add the unit after the textbox on the same line. My issue is space is rather limited so I would like to include the unit info within the textbox if possible, say right-aligned. I know about the HTML5 placeholder attribute but this is only meant to be applicable to empty fields and disappears once data is entered. What I would like

vue 列表、查询、添加、编辑

痴心易碎 提交于 2019-12-18 21:00:48
具体细节: 列表:分页、序号列 查询:下拉菜单(后台回显数据) 添加、编辑:Dialog对话框、表单、下拉菜单、表单数据验证 页面: vue: < template > < section class = "monitoringpoint" > < section style = "margin: 20px 0 0 20px;" > < div style = "padding-left: 20px;" > < el-button type = "primary" @click = "addData" > 添加 < /el-button > < el-form :inline = "true" :model = "query" style = "margin-top: 20px;" size = "small" > < el-form-item label = "站点名称" style = "margin-left: 10px;" > < el-input v-model = "query.siteName" placeholder = "请输入站点名称" > < /el-input > < /el-form-item > < el-form-item label = "所属水体" > < el-select v-model = "query.waterName"