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

jquery實(shí)現(xiàn)圖片跟隨鼠標(biāo)的實(shí)例

 更新時(shí)間:2017年10月17日 11:33:47   作者:焦點(diǎn)  
這篇文章主要介紹了 jquery實(shí)現(xiàn)圖片跟隨鼠標(biāo)的實(shí)例的相關(guān)資料,希望通過本文能幫助到大家實(shí)現(xiàn)這樣的功能,需要的朋友可以參考下

jquery實(shí)現(xiàn)圖片跟隨鼠標(biāo)的實(shí)例

 開發(fā)后臺(tái)寫頁面困難的一比啊,想寫個(gè)鼠標(biāo)移動(dòng)某連接右側(cè)顯示二維碼,并跟隨鼠標(biāo)移動(dòng)的功能,各種查資料,花了一小天終于搞出來了,代碼的記下來,浪費(fèi)了我這么多時(shí)間,記你一輩子,這個(gè)可以直接在W3School直接運(yùn)行,可以根據(jù)某行顯示某個(gè)特定的圖片,自己定義就行

實(shí)現(xiàn)代碼:

<html> 
<head> 
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script> 
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  <title>jquery圖片跟隨鼠標(biāo)</title> 
  <script type="text/javascript"> 
    function hideImg(num){ 
      if(num.className == "1_name"){ 
        $('#1_erweima').hide(); 
      }else if(num.className == "2_name"){ 
        $('#2_erweima').hide(); 
      } 
    } 
 
    function showImg(num) { 
      var intX = window.event.clientX; 
      var intY = window.event.clientY; 
      if (num.className == "1_name") { 
        $('#1_erweima').css("left", intX + 20 + "px"); 
        $('#1_erweima').css("top", intY + 10 + "px"); 
        $('#1_erweima').show(); 
      } else if (num.className == "2_name") { 
        $('#2_erweima').css("left", intX + 20 + "px"); 
        $('#2_erweima').css("top", intY + 10 + "px"); 
        $('#2_erweima').show(); 
      } 
    } 
  </script> 
</head> 
<body> 
<table> 
  <tr> 
    <th> 
      <a  rel="external nofollow" rel="external nofollow" rel="external nofollow" class="1_name" target="_blank" onmouseout="hideImg(this)" onmousemove="showImg(this)" onmouseover="showImg(this)" style="color: #1192cc;">我是百度,會(huì)跟隨</a> 
    </th> 
  </tr> 
  <tr> 
    <th> 
      <a  rel="external nofollow" rel="external nofollow" rel="external nofollow" class="1_name" target="_blank" style="color: #1192cc;">我是百度</a> 
    </th> 
  </tr> 
  <tr> 
    <th> 
      <a  rel="external nofollow" rel="external nofollow" rel="external nofollow" class="2_name" target="_blank" onmouseout="hideImg(this)" onmousemove="showImg(this)" onmouseover="showImg(this)" style="color: #1192cc;">我也是百度,也跟隨</a> 
    </th> 
  </tr> 
  <div id="1_erweima" style="display:none;right:20;position:absolute;"> 
    <img src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo_top_ca79a146.png" /> 
  </div> 
  <div id="2_erweima" style="display:none;right:20;position:absolute;"> 
    <img src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo_top_ca79a146.png" /> 
  </div> 
</table> 
</body> 
</html> 

如有疑問請(qǐng)留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論

正定县| 嫩江县| 读书| 剑阁县| 永登县| 裕民县| 扎赉特旗| 浮梁县| 增城市| 沈丘县| 江达县| 昆明市| 吉安市| 安达市| 玉门市| 文化| 息烽县| 始兴县| 奈曼旗| 高陵县| 大余县| 井陉县| 大新县| 镶黄旗| 鄂州市| 奈曼旗| 灵山县| 阳高县| 沾化县| 永胜县| 桐庐县| 璧山县| 赞皇县| 铁力市| 隆昌县| 博乐市| 绥德县| 将乐县| 德保县| 石嘴山市| 东辽县|