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

fixedBox固定div漂浮代碼支持ie6以上大部分主流瀏覽器

 更新時(shí)間:2014年06月26日 11:30:36   投稿:whsnow  
本例為大家分享的是fixedBox固定div漂浮代碼支持ie6以上大部分瀏覽器,需要的朋友可以參考下

<!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>fixedBox</title>
<script id="xcore" type="text/javascript" src="http://www.haiqiancun.com/xWidget-0.1/xcore.js"></script>
<style>
*{margin:0px;padding:0px;} body{height:3000px;}
</style>
<script>
$(function() { $(".fixedBox").each(function() { 
var self = $(this); 
var id = self.attr("id") || 'fixedBox_' + Math.round(Math.random() * 100000); self.attr("id", id); 
var fb = $("#" + id); 
var mt = Math.floor(fb.css("margin-top").substring(2, 0)) || 0; 
var cd = $('<div style="height:' + fb.outerHeight() + 'px;display:none;' + fb.attr("style") + '">&nbsp;</div>'); fb.after(cd); fb.css({
'z-index': 999
}).data({
'top': fb.offset().top,
'left': fb.offset().left
}); $(window).scroll(function() { 
var pt = fb.data('top'); 
var pl = fb.data('left'); var st = $(document).scrollTop() - 10; 
var h = $(document).height(); 
if (st > pt || st == pt) { cd.show(); 
if ((st + self.outerHeight()) > h) { self.css({
position: 'fixed',
top: (h - (st + self.outerHeight()))
}); 
} else { self.css({
position: 'fixed',
top: 0 - mt
}); 
} 
} else { cd.hide(); self.css({
position: 'relative',
top: 0
}); 
} 
}) 
}) 
}) 
</script>
</span>
</head>
<body>
<div style="width:90%;margin:0px auto;">
<div class="fixedBox" style="margin-top:50px; width:100%; overflow:hidden;background:#fff; font-size:12px;">
&lt;script&gt; $(function(){ $(".fixedBox").each(function(){ 
var self= $(this); var id = self.attr("id")||'fixedBox_'+Math.round(Math.random()*100000);
self.attr("id",id); var fb = $("#"+id); var mt = Math.floor(fb.css("margin-top").substring(2,0))||0;
var cd = $('&lt;div style="width:100%;height:'+fb.outerHeight()+'px;display:none;'+fb.attr("style")+'"&gt;&nbsp;&lt;/div&gt;');
fb.after(cd); fb.css({'z-index':999}).data({'top':fb.offset().top,'left':fb.offset().left});
$(window).scroll(function(){ var pt = fb.data('top'); var pl = fb.data('left');
var st = $(document).scrollTop()-10; var h = $(document).height(); if(st>pt||st==pt){
cd.show(); if((st+self.outerHeight())>h){ self.css({position:'fixed',top:(h-(st+self.outerHeight()))});
}else{ self.css({position:'fixed',top:0-mt}); } }else{ cd.hide(); self.css({position:'relative',top:0});
} }) }) }) &lt;/script&gt;
</div>
例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例子例
</div>
</body>

</html>

相關(guān)文章

  • 分享十三個(gè)最佳JavaScript數(shù)據(jù)網(wǎng)格庫(kù)

    分享十三個(gè)最佳JavaScript數(shù)據(jù)網(wǎng)格庫(kù)

    數(shù)據(jù)網(wǎng)格可以幫助解決在 HTML 表格上對(duì)帶有過(guò)濾、分頁(yè)、排序、搜索以及內(nèi)聯(lián)編輯這些功能特性的大量數(shù)據(jù)集的處理問(wèn)題,需要的朋友可以參考下
    2017-04-04
  • HTA版JSMin(省略修飾語(yǔ)若干)基于javascript語(yǔ)言編寫(xiě)

    HTA版JSMin(省略修飾語(yǔ)若干)基于javascript語(yǔ)言編寫(xiě)

    JSMin是一種很有用的ECMAScript代碼減肥工具,雖然它只是一種較為初級(jí)的工具,但用它來(lái)對(duì)付我自己編寫(xiě)的大部分ECMAScript代碼效果都很不錯(cuò),而且在我這里也從未發(fā)生過(guò)減肥后代碼出錯(cuò)之類的問(wèn)題。
    2009-12-12
  • 淺析Bootstrap驗(yàn)證控件的使用

    淺析Bootstrap驗(yàn)證控件的使用

    這篇文章主要介紹了淺析Bootstrap驗(yàn)證控件的使用 的相關(guān)資料,非常不錯(cuò)具有參考借鑒價(jià)值,需要的朋友可以參考下
    2016-06-06
  • JS新手入門(mén)數(shù)組處理的實(shí)用方法匯總

    JS新手入門(mén)數(shù)組處理的實(shí)用方法匯總

    這篇文章主要給大家介紹了關(guān)于JS新手入門(mén)數(shù)組處理實(shí)用方法的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2021-04-04
  • JS面試之console的異步性怎么理解詳解

    JS面試之console的異步性怎么理解詳解

    這篇文章主要為大家介紹了JS面試之console的異步性怎么理解詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-10-10
  • javascript實(shí)現(xiàn)行拖動(dòng)的方法

    javascript實(shí)現(xiàn)行拖動(dòng)的方法

    這篇文章主要介紹了javascript實(shí)現(xiàn)行拖動(dòng)的方法,涉及javascript鼠標(biāo)事件及頁(yè)面元素的相關(guān)操作技巧,需要的朋友可以參考下
    2015-05-05
  • html2canvas圖片跨域問(wèn)題圖文詳解

    html2canvas圖片跨域問(wèn)題圖文詳解

    我們?cè)谶M(jìn)行圖片保存的時(shí)候經(jīng)常會(huì)發(fā)現(xiàn)圖片跨域了,下面下面這篇文章主要給大家介紹了關(guān)于html2canvas圖片跨域問(wèn)題的相關(guān)資料,需要的朋友可以參考下
    2023-03-03
  • 一個(gè)用js實(shí)現(xiàn)過(guò)濾重復(fù)字符的函數(shù)

    一個(gè)用js實(shí)現(xiàn)過(guò)濾重復(fù)字符的函數(shù)

    一個(gè)用js實(shí)現(xiàn)過(guò)濾重復(fù)字符的函數(shù)...
    2007-08-08
  • 深入了解JavaScript中正則表達(dá)式的使用

    深入了解JavaScript中正則表達(dá)式的使用

    正則表達(dá)式是匹配模式,要么匹配字符,要么匹配位置。在JavaScript中正則表達(dá)式常常用來(lái)驗(yàn)證表單等。本文將帶大家深入了解一下JavaScript中的正則表達(dá)式應(yīng)該如何使用,需要的朋友可以參考一下
    2021-12-12
  • 使用 Opentype.js 生成字體子集的實(shí)例代碼詳解

    使用 Opentype.js 生成字體子集的實(shí)例代碼詳解

    這篇文章主要介紹了使用 Opentype.js 生成字體子集,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-05-05

最新評(píng)論