欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jQuery實(shí)現(xiàn)的超鏈接提示效果示例【附demo源碼下載】

 更新時(shí)間:2016年09月09日 12:04:36   作者:onestopweb  
這篇文章主要介紹了jQuery實(shí)現(xiàn)的超鏈接提示效果,結(jié)合實(shí)例形式對(duì)比分析了jQuery實(shí)現(xiàn)的帶有l(wèi)oading動(dòng)態(tài)圖效果的提示文字以及默認(rèn)提示文字顯示效果,并附帶demo源碼供讀者下載參考,需要的朋友可以參考下

本文實(shí)例講述了jQuery實(shí)現(xiàn)的超鏈接提示效果。分享給大家供大家參考,具體如下:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<style type="text/css">
*{margin:0;padding:0;}
ul li{ list-style:none;}
img {border:0 none;}
body {padding:100px;}
.tooltip{position:absolute;display:none;border:1px solid #333; border-radius:8px; box-shadow:0 0 3px rgba(000,000,000,0.8);background:rgba(247,245,209,0.5);padding:3px;color:#333;display:none;}/* border-radius,box-shadow ie9以下都不兼容 */
</style>
<div class="test">
  <a href="#" class="link" title="這是我的超鏈接提這是我的超<br>
  <strong>鏈接</strong>提這是我的超鏈接提這是<img src='jb51.gif'>我的超<br>
  鏈接提這是我的超鏈接提這是我的超鏈接提示1.">自定義鏈接提示</a>
  <a href="#" class="link">默認(rèn)title提示</a>
  <a href="#" class="link" title="自定義TITLE提示2222?。。?!">自定義鏈接提示</a>
  <a href="#" title="原始鏈接TITLE提示!">原始鏈接title提示</a> </div>
</body>
<script src="jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
  var x=10;
  var y=20;
  $(".link").mouseover(function(e){
    //alert(e.pageX);
    if(typeof($(this).attr('title'))!='undefined'){ // 判斷標(biāo)簽中是否有定義title屬性
      this.my_tit=this.title;
      this.title='';
      var tooltip="<div class='tooltip'>"+this.my_tit+"</div>";
      $("body").append(tooltip);
      $(".tooltip").css({
        display:'block',
        left: e.pageX+x,
        top: e.pageY+y
        })
      };
    }).mouseout(function(){
      if(typeof($(this).attr('title'))!='undefined'){
        this.title=this.my_tit;
        $(".tooltip").remove();
      };
    }).mousemove(function(e){// 鼠標(biāo)移動(dòng)時(shí)跟隨
      $(".tooltip").css({
      left: e.pageX+x,
      top: e.pageY+y
    })
  })
});
</script>
</html>

運(yùn)行效果截圖如下:

完整實(shí)例代碼點(diǎn)擊此處本站下載。

更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常用插件及用法總結(jié)》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery表格(table)操作技巧匯總》、《jquery中Ajax用法總結(jié)》、《jQuery常見(jiàn)經(jīng)典特效匯總》、《jQuery動(dòng)畫(huà)與特效用法總結(jié)》及《jquery選擇器用法總結(jié)

希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論