$(function(){ $(window).on('scroll', function() { var otop = $('.number').offset().top, oheight = $('.number').innerheight(), screenscroll = $(window).scrolltop(), screenheight = $(window).height(); if (($('.timer').text() == "") && (screenscroll < otop + oheight / 3 * 2) && (screenscroll + screenheight > otop + oheight / 3)){ $('.timer').each(count); } }) if($(window).width() < 1004){ $('.title .title-box .left').hover( function(){ $('.title .title-box .line').animate({ "left":"1rem" },500) }, function(){ $('.title .title-box .line').animate({ "left":"3.7rem" },500) } ) }else{ $('.title .title-box .left').hover( function(){ $('.title .title-box .line').animate({ "left":"0.51750rem" },500) }, function(){ $('.title .title-box .line').animate({ "left":"2.145rem" },500) } ) } $(".m-area li").click( function () { $(this).addclass('areaactive'); $(this).siblings().removeclass('areaactive'); let title = $(this).data("title"); let name = $(this).data("name"); let thumb = $(this).data("thumb"); let $alert = $(".alert"); $alert.find("img").attr("src", thumb); $alert.find(".right").html(name); $alert.find(".font").html(title); } ) })