关于javascript浮动显示的问题

<scripttype="text/javascript">//浮动导航functionfloat_nav(dom){varright_nav=$(dom);varnav... <script type="text/javascript">
//浮动导航
function float_nav(dom) {
var right_nav = $(dom);
var nav_height = right_nav.height();
function right_nav_position(bool) {
var window_height = $(window).height();
var nav_top = (window_height - nav_height) / 2;
if (nav_top < 170)
nav_top = 170;
if (bool) {
right_nav.stop(true, false).animate({ top: nav_top + $(window).scrollTop() }, 400);
} else {
right_nav.stop(true, false).animate({ top: nav_top }, 300);
}
right_nav.show();
}

if (!+'\v1' && !window.XMLHttpRequest) {
$(window).bind('scroll resize', function () {
if ($(window).scrollTop() > 300) {
right_nav_position(true);
} else {
right_nav.hide();
}
})
} else {
$(window).bind('scroll resize', function () {
if ($(window).scrollTop() > 300) {
right_nav_position();
} else {
right_nav.hide();
}
})
}
}
float_nav('#float');
float_nav('#left_nav');
</script>

怎样在尾部留 550px高不显示?
展开
 我来答
后盾网PHP教程
2015-12-24 · 超过55用户采纳过TA的回答
知道答主
回答量:89
采纳率:0%
帮助的人:43万
展开全部
可以遮挡ie6下的select元素 但是在ie6下div没有透明度;
弹出的div可以一直在浏览器屏幕中间显示 。
代码:
var _CalF = { //便捷方法
$ : function(id){return document.getElementById(id)},
create : function(id){return document.createElement(id)},
append : function(id){return document.body.appendChild(id)},
remove : function(id){return document.body.removeChild(id)}
}
function popup(openID,conID,closeID){
this.onclick(openID,conID,closeID);
}
popup.prototype = {
cssStyle : "width:100%;position:absolute;left:0;top:0;filter:alpha(opacity = 50);opacity:0.5;border:0;overflow:auto;",
createShadowDiv : function(){ //背景遮罩
var shadowDiv = _CalF.create("div");
shadowDiv.id = "shadowDiv";
shadowDiv.style.cssText = this.cssStyle;
shadowDiv.style.height = document.body.scrollHeight + "px";
shadowDiv.style.backgroundColor = "#000"
shadowDiv.style.zindex = 100;
_CalF.append(shadowDiv);
},
createIframe : function(){ //iframe
var iframe = _CalF.create("iframe");
iframe.id = "shadowIframe";
iframe.style.cssText = this.cssStyle;
iframe.style.height = document.body.scrollHeight + "px";
iframe.style.zindex = 99;
_CalF.append(iframe);
},
removeDiv : function(){
_CalF.remove(_CalF.$("shadowDiv"));
_CalF.remove(_CalF.$("shadowIframe"));
},
onclick : function(openID,conID,closeID){
var that = this;
_CalF.$(openID).onclick = function(){
if(window.ActiveXObject){ //ie6
if(!window.XMLHttpRequest){
document.body.style.cssText = "_background-image: url(about:blank);_background-attachment: fixed;";
}
}
that.createIframe();
that.createShadowDiv();
_CalF.$(conID).style.display = "block";
}
document.getElementById(closeID).onclick = function(){
_CalF.$(conID).style.display = "none";
that.removeDiv();
}
}
}
var bt = new popup("bt","orderMsg","close");
</script>
</body>
</html>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式