首页 新闻 会员 周边 捐助

紧急求救!求高手帮忙改下一小段代码,很简单的

0
悬赏园豆:30 [已解决问题] 解决于 2010-09-30 09:46
<!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>
<title>MSN QQ</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
var Obj=0;
var Speed=1;
var Time1=10;
var DivHeight=100;
Obj
=-DivHeight;
function Up()
{
$(
"#qq").css("display","block");
Obj
+=Speed;
$(
"#qq").css("bottom",Obj);
if(Math.abs(Obj)<Speed){
clearTimeout(settime);
}
else
var settime = setTimeout("Up()",10);
}
$(document).ready(
function(){
Up();
})
</script>
<style type="text/css">
body
{margin:0px;padding:0px;}
#back
{height:1000px;width:100%;background:black;top:0px;left:0px;filter:alpha(opacity=30);opacity:0.3;}
#qq
{display:none;height:100px;width:100px; right:0px;bottom:0px;z-index:999;background:red;position:fixed!important;position:absolute;
}
</style>
</head>
<body>
<div id="qq">
</div>
<div id="back">
</div>
</body>
</html>

这个是全部代码了!现在已兼容ie7 8 ff
就是ie6有问题,不能始终固定在右下角
求高手帮帮忙
ps:不用发什么右下角弹出的代码了,也不用发链接,谢谢!只想改上面的代码让它兼容ie6

希望高手帮帮忙

蓝丶 sky的主页 蓝丶 sky | 初学一级 | 园豆:6
提问于:2010-09-02 10:10
< >
分享
最佳答案
0

你的JS代码我没改,不过我相信下面的代码你更需要,你直接放到页面里就可以了.

 

1 (function(){var ua=navigator.userAgent.toLowerCase();var is=(ua.match(/\b(chrome|opera|safari|msie|firefox)\b/)||['','mozilla'])[1];var r='(?:'+is+'|version)[\\/: ]([\\d.]+)';var v=(ua.match(new RegExp(r))||[])[1];jQuery.browser.is=is;jQuery.browser.ver=v;jQuery.browser[is]=true})();(function(jQuery){this.version='@1.5';this.layer={'width':200,'height':100};this.title='信息提示';this.time=180000;this.anims={'type':'slide','speed':600};this.timer1=null;this.inits=function(title,text){if($("#message").is("div")){return}
2 $(document.body).prepend('<div id="message" style="border:#b9c9ef 1px solid;z-index:100;width:'
3  +this.layer.width
4  +'px;height:'
5 +this.layer.height
6 +'px;position:absolute; display:none;background:#cfdef4; bottom:0; right:0; overflow:hidden;"><div style="border:1px solid #fff;border-bottom:none;width:100%;height:25px;font-size:12px;overflow:hidden;color:#1f336b;"><span id="message_close" style="float:right;padding:5px 0 5px 0;width:16px;line-height:auto;color:red;font-size:12px;font-weight:bold;text-align:center;cursor:pointer;overflow:hidden;">×</span><div style="padding:5px 0 5px 5px;width:100px;line-height:18px;text-align:left;overflow:hidden;">'
7 +title
8 +'</div><div style="clear:both;"></div></div> <div style="padding-bottom:5px;border:1px solid #fff;border-top:none;width:100%;height:auto;font-size:12px;"><div id="message_content" style="margin:0 5px 0 5px;border:#b9c9ef 1px solid;padding:10px 0 10px 5px;font-size:12px;width:'
9 +(this.layer.width-17)
10 +'px;height:'
11 +(this.layer.height-50)
12 +'px;color:#1f336b;text-align:left;overflow:hidden;line-height:150%">'
13 +text+'</div></div></div>');$("#message_close").click(function(){setTimeout('this.close()',1)});$("#message").hover(function(){clearTimeout(timer1);timer1=null},function(){if(time>0)
14 timer1=setTimeout('this.close()',time)});$(window).scroll(function(){var bottomHeight="-"+document.documentElement.scrollTop;$("#message").css("bottom",bottomHeight+"px")})};this.show=function(title,text,time){if($("#message").is("div")){return}
15 if(title==0||!title)
16 title=this.title;this.inits(title,text);if(time>=0)
17 this.time=time;switch(this.anims.type){case'slide':$("#message").slideDown(this.anims.speed);break;case'fade':$("#message").fadeIn(this.anims.speed);break;case'show':$("#message").show(this.anims.speed);break;default:$("#message").slideDown(this.anims.speed);break}
18 var bottomHeight="-"+document.documentElement.scrollTop;$("#message").css("bottom",bottomHeight+"px");if($.browser.is=='chrome'){setTimeout(function(){$("#message").remove();this.inits(title,text);$("#message").css("display","block")},this.anims.speed-(this.anims.speed/5))}
19 this.rmmessage(this.time)};this.lays=function(width,height){if($("#message").is("div")){return}
20 if(width!=0&&width)
21 this.layer.width=width;if(height!=0&&height)
22 this.layer.height=height}
23 this.anim=function(type,speed){if($("#message").is("div")){return}
24 if(type!=0&&type)
25 this.anims.type=type;if(speed!=0&&speed){switch(speed){case'slow':;break;case'fast':this.anims.speed=200;break;case'normal':this.anims.speed=400;break;default:this.anims.speed=speed}}}
26 this.rmmessage=function(time){if(time>0){timer1=setTimeout('this.close()',time)}};this.close=function(){switch(this.anims.type){case'slide':$("#message").slideUp(this.anims.speed);break;case'fade':$("#message").fadeOut(this.anims.speed);break;case'show':$("#message").hide(this.anims.speed);break;default:$("#message").slideUp(this.anims.speed);break};setTimeout('$("#message").remove();',this.anims.speed);this.original()}
27 this.original=function(){this.layer={'width':200,'height':100};this.title='信息提示';this.time=180000;this.anims={'type':'slide','speed':600}};jQuery.messager=this;return jQuery})(jQuery);
28
29 var url = "";var userInfo = "";var msgContent = "";
30
31 $().ready(function(){return ShowBox()});
32 function ShowBox(){
33 if(GetMsgContent()){
34 $.messager.lays(300, 200);
35 $.messager.show(0, userInfo+"<br />"+msgContent);
36 }
37 url="";userInfo="";msgContent="";delete url;delete userInfo;delete msgContent;return true
38 }
39 function GetMsgContent()
40 {//此处也可改为Ajax的json方式获取动态数据
41 userInfo="Hi,你有新的消息,请查看:"
42 msgContent+="<li>今晚一起去吃饭吧</li>";
43 return true;
44 }
收获园豆:15
第一印象 | 初学一级 |园豆:79 | 2010-09-02 13:25
记得导入Jquery包
第一印象 | 园豆:79 (初学一级) | 2010-09-02 13:26
其他回答(1)
0

jquery-1.3.2.min.js换成jquery-1.4.2.min.js试试

收获园豆:15
一滴血 | 园豆:1602 (小虾三级) | 2010-09-02 16:29
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册