DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> JavaScript綜合知識 >> jquery鼠標放上去顯示懸浮層即彈出定位的div層
jquery鼠標放上去顯示懸浮層即彈出定位的div層
編輯:JavaScript綜合知識     

 代碼如下:

<script language="javascript" src="jquery-1.4.2.min.js"></script>  <script>  function show(obj,id) {  var objDiv = $("#"+id+"");  $(objDiv).css("display","block");  $(objDiv).css("left", event.clientX);  $(objDiv).css("top", event.clientY + 10);  }  function hide(obj,id) {  var objDiv = $("#"+id+"");  $(objDiv).css("display", "none");  }  </script>    <!--http://www.ablanxue.com/prone_3421_1.html-->    <div id="mydiv1" style="position:absolute;display:none;border:1px solid silver;background:silver;">  提示1效果  </div>  <div id="mydiv2" style="position:absolute;display:none;border:1px solid silver;background:silver;">  提示2效果  </div>    <a id="t1" onMouseOver="javascript:show(this,'mydiv1');" onMouseOut="hide(this,'mydiv1')">鼠標放上去1</a>  <br><br><br><br><br>  <a id="t2" onMouseOver="javascript:show(this,'mydiv2');" onMouseOut="hide(this,'mydiv2')">鼠標放上去2</a> 
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved