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().top,
oInput = $("
阅读(600) | 评论(0) | 转发(0) |