右侧滑动悬浮【jquery】

来源:互联网 发布:手持数据采集器软件 编辑:程序博客网 时间:2024/04/28 19:25
/*====右侧滑动悬浮*/
$(document).ready(function() {
/*右侧滑动*/
$('#qianqi ul li a').not('#back-to-top,#back-to-bot,#qianqi ul li a:eq(1)').on('mouseover', function() {


$(this).stop().animate({
"width": "75px"
}, 100).find('i').stop().fadeIn();
}).on('mouseout', function() {


$(this).stop().animate({
"width": "36px"
}, 200).find('i').stop().fadeOut();;


});


$('#qianqi ul li:eq(2)').addClass('pl_showa');


$('.pl_showa a').on('mouseover', function() {


$(this).children('span').show().css({
"margin-right": "-4px"
});


}).on('mouseout', function() {


$(this).children('span').hide();


});


$(this).find('#back-to-top').hide();
//顶部
$(window).scroll(function() {
if ($(window).scrollTop() > 100) {
$("#back-to-top").fadeIn(500);
} else {
$("#back-to-top").fadeOut(500);
}
});
//点击返回顶部
$("#back-to-top").click(function() {
$('body,html').animate({
scrollTop: 0
}, 80);
return false;
});
//底部
$(window).scroll(function() {
if ($(window).scrollTop() >= $(document).height() - $(window).height()) {
$("#back-to-bot").fadeOut(500);
} else {
$("#back-to-bot").fadeIn(500);
}
});
//点击返回底部
$("#back-to-bot").click(function()


{
$('body,html').animate({
scrollTop: $(document).height() - $(window).height()
}, 80);
return false;
});
});
0 0
原创粉丝点击