$(function() {
window.top.iframeHeight();
window.parent.iframeHeight();
// 回到顶部插件
function toTop() {
var container = $("<div id='toTop'>");
container.css({
'position':'fixed',
'bottom':'30px',
'right':'30px',
'zIndex':'999',
'overflow':'hidden',
});
container.hide()
var img = $("<img src='/images/toTop.png' width='50' title='回到顶部'>");
$("body").append(container);
container.append(img);
$("#toTop").click(function(){
var speed=200;//滑动的速度
$('body,html').animate({ scrollTop: 0 }, speed);
return false;
})
}
toTop();
$(window).scroll(function(){
if ($(window).scrollTop()>100){
$("#toTop").fadeIn(500);
}else{
$("#toTop").fadeOut(500);
}
})
});
window.top.iframeHeight();
window.parent.iframeHeight();
// 回到顶部插件
function toTop() {
var container = $("<div id='toTop'>");
container.css({
'position':'fixed',
'bottom':'30px',
'right':'30px',
'zIndex':'999',
'overflow':'hidden',
});
container.hide()
var img = $("<img src='/images/toTop.png' width='50' title='回到顶部'>");
$("body").append(container);
container.append(img);
$("#toTop").click(function(){
var speed=200;//滑动的速度
$('body,html').animate({ scrollTop: 0 }, speed);
return false;
})
}
toTop();
$(window).scroll(function(){
if ($(window).scrollTop()>100){
$("#toTop").fadeIn(500);
}else{
$("#toTop").fadeOut(500);
}
})
});