');
$('#sec2 div').each(function(){
$(this).html('
' + $(this).parent().children('img').attr('alt') + '
');
});
$('#sec2 li').hover(function(){
//hover時の処理
$('> div',this).css('display','flex');
$('> div',this).stop().fadeIn(300);
$('> div > p',this).stop().animate({
'top' : 0
},300);
},function(){
//マウスが離れた時の処理
$('> div',this).stop().fadeOut(300);
$('> div > p',this).stop().animate({
'top' : '10px'
},300);
});
});
※ $(function()...はScriptタグまたはjsファイル内に1つで良いのですが、
個別に使用することを考慮して一つ一つに $(function()を使っています。
$('.responsive').slick({
dots: true,
infinite: true,
speed: 300,
slidesToShow: 4,
slidesToScroll: 4,
autoplay: true,
autoplaySpeed: 2000,
responsive: [
{
breakpoint: 980,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
dots: true
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
// {
// breakpoint: 480,
// settings: {
// slidesToShow: 1,
// slidesToScroll: 1
// }
// }
]
});