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

jquery實(shí)現(xiàn)鼠標(biāo)懸浮彈出氣泡提示框

 更新時間:2020年12月23日 10:31:27   作者:qq_45966300  
這篇文章主要為大家詳細(xì)介紹了jquery實(shí)現(xiàn)鼠標(biāo)懸浮彈出氣泡提示框,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下

jquery鼠標(biāo)懸浮彈出氣泡提示框,供大家參考,具體內(nèi)容如下

居中的圖片

代碼

我在網(wǎng)上找了很多例子都是單獨(dú)的一個,所以我修改了jquery的一點(diǎn)代碼,讓它可以在一個頁面上多次使用,原文的地址我沒找到,相信我這個會更好一點(diǎn)。

//別忘了導(dǎo)入js文件!

<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <title>氣泡顯示</title>
 <script type="text/javascript" src="../js/jquery-1.8.3.js" ></script>
 <style type="text/css">
  .container {
   margin-top: 130px;
  }
  .tip {
   padding: 8px 12px;
   width: 140px;
   display: block;
   font-size: 16px;
   color: #fff;
   font-weight: bold;
   background: #ED5517;
   cursor: pointer;
   margin-left: 400px;
   align-content: center;
   margin-top: 20px;
   margin-bottom: 20px;
  }
  .content {
   position: absolute;
   display: none;
   padding: 10px;
   width: 160px;
   background: #e0edf7;
   border-radius: 6px;
  }

  .content::before {
   content: "";
   position: relative;
   top: -20px;
   left: 10px;
   width: 0;
   height: 0;
   display: block;
   border-left: 10px solid transparent;
   border-right: 10px solid transparent;
   border-bottom: 10px solid #e0edf7;
  }
 </style>
</head>
<body>
<div class="container">
 <span id="xsztip" class="tip">鼠標(biāo)懸停顯示氣泡</span>
 <div class="content">
  <span>The quick fox jumps over a lazy dog.</span>
 </div>
 <span id="xsztip2" class="tip">鼠標(biāo)懸停顯示氣泡</span>
 <div class="content">
  <span>The quick fox jumps over a lazy dog.</span>
 </div>
 <span id="xsztip3" class="tip">鼠標(biāo)懸停顯示氣泡</span>
 <div class="content">
  <span>The quick fox jumps over a lazy dog.</span>
 </div>
</div>
<script type="text/javascript">
 $(function(){
  $("#xsztip").hover(function(){
   show_xszimg(this);
  },function(){
   hide_xszimg(this);
  });
  $("#xsztip2").hover(function(){
   show_xszimg(this);
  },function(){
   hide_xszimg(this);
  });
  $("#xsztip3").hover(function(){
   show_xszimg(this);
  },function(){
   hide_xszimg(this);
  });
  function hide_xszimg(f){
   $(f).next().hide()
  }
  function show_xszimg(f){
   var c=$(f);
   var e=c.offset();
   var a=e.left;
   var b=e.top+40;
   $(f).next().css({left:a+"px",top:b+"px"}).show();
  }
 });
</script>
</body>
</html>

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

尉氏县| 城市| 施甸县| 诸暨市| 临泽县| 丘北县| 峡江县| 晋州市| 勃利县| 新平| 南华县| 高阳县| 措美县| 石林| 犍为县| 西和县| 喀什市| 精河县| 鱼台县| 承德县| 布尔津县| 腾冲县| 东至县| 鄱阳县| 获嘉县| 鱼台县| 泽库县| 桐庐县| 昭苏县| 滨海县| 南江县| 卓资县| 昌江| 郯城县| 调兵山市| 青冈县| 潼南县| 岳西县| 衡东县| 那曲县| 巨鹿县|