jquery 彈表單提示效果代碼
<style type="text/css教程">
focus
{
border:px solid #fc !important;
background: url(admin/images/focus_bgjpg) repeat x !important;
color: #f !important;
}
/*提示文字樣式*/
#hintmsg
{
width:px;
position: absolute;
display: none;
}
#hintmsghinttop
{
height:px;
background: url(admin/images/hintbggif) no repeat;
overflow: hidden;
}
#hintmsghintinfo
{
padding:px;
borderleft: px solid # ;
borderright: px solid # ;
background: #ffffe;
lineheight: em;
}
#hintmsghintinfo b
{
display: block;
marginbottom: px;
paddingleft: px;
background: url(admin/images/hintgif) left center no repeat;
height:px;
lineheight: px;
}
#hintmsghintinfo b span
{
display: block;
float: right;
textindent: px;
background: url(admin/images/closegif) no repeat;
width:px;
height:px;
cursor: pointer;
}
#hintmsghintfooter
{
height:px;
background: url(admin/images/hintbggif) no repeat;
}
</style><script>
$(function() {
$("input login_input 動畫
$("#hintmsg")remove(); //先清除 防止重復出錯
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>"; //設置顯示的內容
var offset = $(this)offset(); //取得事件對象的位置
$("body")append(hinthtml); //添加節點
$("#hintmsg")fadeto( ); //對象的透明度
var hintheight = $("#hintmsg")height(); //取得容器高度
$("#hintmsg")css({ "top": offset top hintheight + "px" "left": offset left + "px" }) fadein( );
})blur(function(event) {
$("#hintmsg")remove(); //刪除ul
});
});
</script>
<form id="form" runat="server">
<div>
<div style="margintop: px">
<asp教程:textbox id="textbox" runat="server" hinttitle="增加的內容信息標題" hintinfo="控制在 個字數內 標題文本盡量不要太長 "></asp:textbox></div>
</div>
</form>
From:http://tw.wingwit.com/Article/program/Java/hx/201405/30805.html