Created
January 2, 2019 05:25
-
-
Save kenzo-tanaka/285adf5f53e32d170aa56bf7f552bd03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$(window).scroll(function(){ | |
var windowHeight =$(window).height(); | |
var windowTop =$(window).scrollTop(); | |
$(".underline1").each(function(){ | |
var objectImage =$(this).offset().top; | |
if(windowTop > objectImage - windowHeight*1/2){$(this).css("background-size","100% 100%")}; | |
}); | |
$(".underline2").each(function(){ | |
var objectImage =$(this).offset().top; | |
if(windowTop > objectImage - windowHeight*1/2){$(this).css("background-size","100% 100%")}; | |
}); | |
$(".underline3").each(function(){ | |
var objectImage =$(this).offset().top; | |
if(windowTop > objectImage - windowHeight*1/2){$(this).css("background-size","100% 100%")}; | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment