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

jQuery實(shí)現(xiàn)的兼容性浮動(dòng)層示例

 更新時(shí)間:2016年08月02日 09:16:30   作者:Quber  
這篇文章主要介紹了jQuery實(shí)現(xiàn)的兼容性浮動(dòng)層,可兼容IE、火狐等主流瀏覽器,涉及jQuery針對(duì)頁(yè)面元素的運(yùn)算與屬性的動(dòng)態(tài)設(shè)置相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了jQuery實(shí)現(xiàn)的兼容性浮動(dòng)層。分享給大家供大家參考,具體如下:

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

具體代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>jQuery浮動(dòng)層</title>
  <style type="text/css">
    #test
    {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 430px;
      height: 300px;
      background: #EEF2FB;
      color: Black;
      font-size: 13px;
      margin-top: 50px;
      left: 50%;
      margin: 0px 0 0 -215px;
      text-align: center;
      font-size: 16px;
      border: 1px dotted green;
    }
  </style>
  <script src="jquery-1.7.2.min.js" type="text/javascript"></script>
  <script type="text/javascript" language="javascript">
    $(document).ready(function () {
      var menuYloc = $("#test").offset().top;
      var menuXloc = $("#test").offset().right;
      $(window).scroll(function () {
        var offsetTop = menuYloc + $(window).scrollTop() + "px";
        $("#test").animate({
          top: offsetTop
        }, {
          duration: 600, queue: false
        });
      });
    });
  </script>
</head>
<body>
  <div>
    <div id="test">
      我就是懸浮的DIV區(qū)域<br />
      兼容:Test ie6+,firefox3.0</div>
  </div>
  <div style="height: 5000px;">
  </div>
</body>
</html>

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

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

相關(guān)文章

最新評(píng)論

江都市| 革吉县| 四子王旗| 安岳县| 德州市| 岐山县| 吐鲁番市| 宜丰县| 利川市| 辽阳市| 广平县| 环江| 天峻县| 潍坊市| 游戏| 峨山| 遂溪县| 松阳县| 盐池县| 九江县| 江油市| 曲周县| 玉山县| 兴文县| 扎囊县| 巴中市| 阿克陶县| 曲阜市| 六枝特区| 永春县| 蓝山县| 靖西县| 禹州市| 宁乡县| 潮州市| 祁阳县| 武功县| 石渠县| 且末县| 城固县| 秀山|