最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

表單JS彈出填寫提示效果代碼

 更新時(shí)間:2011年04月16日 17:52:12   作者:  
表單JS彈出填寫提示效果代碼,需要的朋友可以參考下。
HTML
復(fù)制代碼 代碼如下:

<form id="form1" runat="server">
<div>
<div style="margin-top:100px">
<asp:TextBox ID="TextBox1" runat="server" HintTitle="增加的內(nèi)容信息標(biāo)題" HintInfo="控制在100個(gè)字?jǐn)?shù)內(nèi),標(biāo)題文本盡量不要太長。"></asp:TextBox></div>
</div>
</form>

頁面中的樣式
復(fù)制代碼 代碼如下:

<style type="text/css">
.focus
{
border: 1px solid #FC0 !important;
background: url(Admin/Images/focus_bg.jpg) repeat-x !important;
color: #00F !important;
}
/*提示文字樣式*/
#HintMsg
{
width: 271px;
position: absolute;
display: none;
}
#HintMsg .HintTop
{
height: 9px;
background: url(Admin/Images/hintbg1.gif) no-repeat;
overflow: hidden;
}
#HintMsg .HintInfo
{
padding: 0 5px;
border-left: 1px solid #000;
border-right: 1px solid #000;
background: #FFFFE1;
line-height: 1.5em;
}
#HintMsg .HintInfo b
{
display: block;
margin-bottom: 6px;
padding-left: 15px;
background: url(Admin/Images/hint.gif) left center no-repeat;
height: 13px;
line-height: 16px;
}
#HintMsg .HintInfo b span
{
display: block;
float: right;
text-indent: -9999px;
background: url(Admin/Images/close.gif) no-repeat;
width: 12px;
height: 12px;
cursor: pointer;
}
#HintMsg .HintFooter
{
height: 22px;
background: url(Admin/Images/hintbg2.gif) no-repeat;
}
</style>

關(guān)鍵JS
復(fù)制代碼 代碼如下:

$(function() {
$(".input,.login_input,.textarea").focus(function() {
$(this).addClass("focus");
}).blur(function() {
$(this).removeClass("focus");
});
//輸入框提示,獲取擁有HintTitle,HintInfo屬性的對象
$("[HintTitle],[HintInfo]").focus(function(event) {
$("*").stop(); //停止所有正在運(yùn)行的動畫
$("#HintMsg").remove(); //先清除,防止重復(fù)出錯
var HintHtml = "<ul id=\"HintMsg\"><li class=\"HintTop\"></li><li class=\"HintInfo\"><b>" + $(this).attr("HintTitle") + "</b>" + $(this).attr("HintInfo") + "</li><li class=\"HintFooter\"></li></ul>"; //設(shè)置顯示的內(nèi)容
var offset = $(this).offset(); //取得事件對象的位置
$("body").append(HintHtml); //添加節(jié)點(diǎn)
$("#HintMsg").fadeTo(0, 0.85); //對象的透明度
var HintHeight = $("#HintMsg").height(); //取得容器高度
$("#HintMsg").css({ "top": offset.top - HintHeight + "px", "left": offset.left + "px" }).fadeIn(500);
}).blur(function(event) {
$("#HintMsg").remove(); //刪除UL
});
});

效果圖:

 

以上內(nèi)容來子一個(gè)下載的網(wǎng)站,具體的名字忘記了....僅作參考

相關(guān)文章

最新評論

永康市| 顺义区| 剑河县| 双鸭山市| 六安市| 临沂市| 清苑县| 克什克腾旗| 寿光市| 盘山县| 额敏县| 福鼎市| 华池县| 柳州市| 阿拉善右旗| 镇沅| 城口县| 南京市| 莒南县| 台山市| 德阳市| 夏河县| 天镇县| 霍林郭勒市| 婺源县| 城口县| 巴彦县| 文登市| 常宁市| 威海市| 寻乌县| 大余县| 迁西县| 东明县| 阿瓦提县| 大兴区| 安康市| 泸州市| 喀喇沁旗| 田林县| 安图县|