Last active
January 6, 2018 21:08
-
-
Save muks999/0d702b1d3e215850218f56ccea94ad79 to your computer and use it in GitHub Desktop.
jQuery Plugin Start
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($) { | |
$.fn.myParallax = function(){ | |
return this.each(function() { | |
var ths = $(this); | |
ths | |
.css({ | |
"min-height" : "400px", | |
"position" : "relative", | |
"overflow" : "hidden" | |
}) | |
.wrapInner("<div class='parallax-content' style='position:relative; z-index:1'>") | |
.prepend("<div class='image-parallax' style='background-image:url(" + ths.data('parallax-image') + "); background-size:cover; background-position:top; position:absolute; top=0; width:100%' >"); | |
$(window).scroll(function() { | |
}).load(function() { | |
}); | |
}); | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment