jQuery實(shí)現(xiàn)的兼容性浮動(dòng)層示例
本文實(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常見經(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ì)有所幫助。
- jQuery實(shí)現(xiàn)div浮動(dòng)層跟隨頁(yè)面滾動(dòng)效果
- jQuery實(shí)現(xiàn)浮動(dòng)層隨瀏覽器滾動(dòng)條滾動(dòng)的方法
- jQuery實(shí)現(xiàn)點(diǎn)擊按鈕彈出可關(guān)閉層的浮動(dòng)層插件
- jquery簡(jiǎn)單的彈出層浮動(dòng)層代碼
- jQuery實(shí)現(xiàn)可拖動(dòng)的浮動(dòng)層完整代碼
- jQuery頁(yè)面滾動(dòng)浮動(dòng)層智能定位實(shí)例代碼
- 基于jquery的浮動(dòng)層效果代碼
- jQuery powerFloat萬(wàn)能浮動(dòng)層下拉層插件使用介紹
- 基于JQuery的浮動(dòng)DIV顯示提示信息并自動(dòng)隱藏
- JQuery浮動(dòng)DIV提示信息并自動(dòng)隱藏的代碼
- jQuery實(shí)現(xiàn)的浮動(dòng)層div瀏覽器居中顯示效果
相關(guān)文章
jQuery插件uploadify實(shí)現(xiàn)ajax效果的圖片上傳
本文主要介紹使用jQuery插件uploadify實(shí)現(xiàn)ajax效果的圖片上傳的功能,有需要的朋友可以參考一下。2016-06-06
jQuery插件實(shí)現(xiàn)控制網(wǎng)頁(yè)元素動(dòng)態(tài)居中顯示
這篇文章主要介紹了jQuery插件實(shí)現(xiàn)控制網(wǎng)頁(yè)元素動(dòng)態(tài)居中顯示,實(shí)例分析了jQuery插件的實(shí)現(xiàn)與元素動(dòng)態(tài)顯示的技巧,需要的朋友可以參考下2015-03-03
jQuery Study Notes學(xué)習(xí)筆記 (二)
jquery簡(jiǎn)單選擇器的使用方法。jquery中最基本的東西了。2010-08-08
jQuery實(shí)現(xiàn)圖像旋轉(zhuǎn)動(dòng)畫效果
jquery動(dòng)畫旋轉(zhuǎn)效果在項(xiàng)目中經(jīng)常遇到這樣的需求,下面小編給大家分享具體實(shí)現(xiàn)代碼,感興趣的朋友一起學(xué)習(xí)吧2016-05-05
ExtJs動(dòng)態(tài)生成treepanel的Json格式
這篇文章主要介紹了ExtJs動(dòng)態(tài)生成treepanel的Json格式的相關(guān)資料,需要的朋友可以參考下2015-07-07
jQuery實(shí)現(xiàn)左右兩個(gè)列表框的內(nèi)容相互移動(dòng)功能示例
這篇文章主要介紹了jQuery實(shí)現(xiàn)左右兩個(gè)列表框的內(nèi)容相互移動(dòng)功能,涉及jQuery事件響應(yīng)及頁(yè)面元素屬性動(dòng)態(tài)操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2019-01-01

