我想做一个效果,一个层,随着滚动条而滚动样式
#tip { width:400px; height:200px; background-color:White; position:absolute; left:400px; top:300px; z-index:9999; line-height:23px; display:none;}js
$(window).scroll(function () {
var offsetTop = 300 + $(window).scrollTop() + "px";
$("#tip").css({"top":offsetTop});
});出现闪屏现象,怎样优化。
#tip { width:400px; height:200px; background-color:White; position:absolute; left:400px; top:300px; z-index:9999; line-height:23px; display:none;}js
$(window).scroll(function () {
var offsetTop = 300 + $(window).scrollTop() + "px";
$("#tip").css({"top":offsetTop});
});出现闪屏现象,怎样优化。
html {
_background-image:url(about:blank);
}
试试
$("#tip").animate({ top: offsetTop }, { speed: "fast", queue: false });----------
我加分,问另外一个问题
做遮罩层
#overlay { background:#000;opacity:0.5;position:fixed; top:0px; left:0px; width:100%; height:100%; z-index:100; display:none;} $("#showmask").click(function () {
$("#overlay").css({ "opacity": "0.5" }).show();
$("#tip").fadeIn("slow");
});在IE6下,width:100%,height100%,怎样让层铺满全屏。
关于IE6不支持fixed
_position:absolute;_top:expression(document.scrollTop+"px");