Code Pad
Code
List Code
Search Code
Images
List Images
Search Images
Login
Privacy
Home
animate stuff detecting window scroll position
jquery ui datepicker
js
styling css elements based on their attributes
css
animate background gradient css
css
linear gradient background with 3 colours
css
web storage testing
js
load a script based on a page condition variable
jquery
loop through elements and change the content using each and substr with jquery
jquery
mega menu testing
css
basic foundation grid layout
html
animate stuff detecting window scroll position
10:52 pm, March 4, 2018
Code
html
css
js
scripts
html
Scroll Postion:
0
demo padding
demo padding
demo padding
animated box
animated box
animated box
animated box
demo padding
demo padding
demo padding
css
.scroll-pos { font-size:16px; background:rgba(0,0,0,0.9); color:#FFF; text-shadow:0px 1px 2px #000; position:fixed; bottom:0; right:0; padding:5px 10px; }
js
$(window).scroll(function() { $('#scrollpos').html($(document).scrollTop()); var scrollpos = $(document).scrollTop(); if(scrollpos >= 594) { animate_boxes(); } else { unanimate_boxes(); } }); function animate_boxes() { $('#ab1').removeClass("hide").addClass("rotateInDownLeft slideInLeft"); $('#ab2').removeClass("hide").addClass("rotateInDownLeft"); $('#ab3').removeClass("hide").addClass("rotateInDownRight"); $('#ab4').removeClass("hide").addClass("rotateInDownRight slideInRight"); } function unanimate_boxes() { $('#ab1').removeClass("rotateInDownLeft slideInLeft").addClass("hide"); $('#ab2').removeClass("rotateInDownLeft").addClass("hide"); $('#ab3').removeClass("rotateInDownRight").addClass("hide"); $('#ab4').removeClass("rotateInDownRight slideInRight").addClass("hide"); }
scripts
Download & Run
Download File
Run Demo
Re-load Preview
Preview
fKcRU