This time I will share jQuery Plugin and tutorial about Zoom In Image On Vertical Page Scrolling, hope it will help you in programming stack.
An image zoom effect for hero section of your webpage that zooms in the image on vertical page scrolling using jQuery and CSS.
How to use it:
1. Add an image to the hero section.
1 |
< section class = "hero-section" id = "js-hero" > |
2. The necessary CSS/CSS3 styles for the hero section & image.
13 |
transform: translate( -50% ); |
3. Add the latest version of jQuery JavaScript library to the page.
2 |
integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" |
3 |
crossorigin = "anonymous" > |
4. The JavaScript (jQuery script) to zoom the hero image on scroll.
1 |
$(window).scroll( function () { |
2 |
var scroll = $(window).scrollTop(); |
3 |
$( "#js-hero img" ).css({ |
4 |
width: (100 + scroll/5) + "%" |
This awesome jQuery plugin is developed by Jason D’Oyley. For more Advanced Usages, please check the demo page or visit the official website.