TOP图片:<img id="toTop" src="images/scroll_to_top.gif" width="38" height="68" alt="Scroll to Top" title="Scroll to Top" />
点击TOP回滚到顶部js如下:
<script type="text/javascript">
jQuery.noConflict();
(function($) {
var ScrolltoTop = $("#toTop");
$(ScrolltoTop).hide();
$(window).scroll(function() {
if ($(window).scrollTop() == "0") {
$(ScrolltoTop).fadeOut("slow")
} else {
$(ScrolltoTop).fadeIn("slow")
}
});
$(ScrolltoTop).click(function() {
$('html, body').animate({
scrollTop: 0
},
700)
})
})(jQuery);
</script>
浮动样式如下:
.online{
width:110px;overflow:hidden; position: fixed;top:32%; z-index:999;right:25px;
_position:absolute; _bottom:auto;
_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-450));
}
我做的商城其一案例demo:
奥姿女装商城 http://www.aozimall.com/