Skip to content

Instantly share code, notes, and snippets.

@janily
Created July 24, 2013 03:59
Show Gist options
  • Save janily/6067978 to your computer and use it in GitHub Desktop.
Save janily/6067978 to your computer and use it in GitHub Desktop.
scroll page
//七行代码实现层随屏幕滚动
$(function(){
var chatbox = $(".chatbox").offset().top;
$(window).scroll(function (){
var offsetTop = chatbox + $(window).scrollTop() +"px";
$(".chatbox").animate({top : offsetTop },{ duration:800 , queue:false });
});
})
//鼠标经过图片,其他图片渐隐效果
$(function(){
$(".imglinks").find("a").each(function() {
$(this).hover(function(){
$(this).siblings().stop()
.fadeTo(500,0.4);
},
function(){
$(this).siblings().stop()
.fadeTo(500,1);
});
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment