If you look at the Google homepage, you’ll notice the following image tag:
- <img alt="Google" height="92" id="hplogo"
- src="/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
- …
- onload="window.lol&&lol()">
So when the image tag is loaded, JavaScript checks if 1) a function named `lol` exists, and 2) if so, it runs that function.
What does the function do? Well, it turns out that the function named `lol` will resize and/or relocate the logo image depending on the screen size. So basically it’s responsive web design.
And what does `lol` mean here?
Well, it’s just short for “logo On Load”
0 comments:
Post a Comment