jQuery まとめ 2017 11 memo

jQuery(function(){
var setArea = jQuery('.scrEvent'),
showHeight = 200;

setArea.css({display:'block',opacity: '0'});

jQuery(window).on('load scroll resize',function(){
setArea.each(function(){
var setThis = jQuery(this),
areaTop = setThis.offset().top;

if (jQuery(window).scrollTop() > (areaTop + showHeight) - jQuery(window).height()) {
setThis.stop().animate({opacity: '1'}, 900);
} else {
setThis.stop().animate({opacity: '0'}, 900);
}

});
});
});


/* スクロール fixed #sidebar */
jQuery(function(){
jQuery(window).on('scroll', function() {
if(jQuery(window).scrollTop() > 50 && jQuery(window).scrollTop() < 1200) {
jQuery('#sidebar').addClass('fixed');
} else {
jQuery('#sidebar').removeClass('fixed');
}
});
});

 

/*--- もっと見る ---*/
jQuery(function(){
jQuery('.show_c').hide();
jQuery('.bt').click(function(){
jQuery('.show_c').slideToggle();
});
});


jQuery(function(){
jQuery('.bt5').click(function(){
jQuery('.show_c').slideToggle();
});
});