html - jQuery scroll to a section and stick before continued scrolling -
not sure feature called, uses jquery's easing features. this site job of it. basically, auto scrolls the next section , sticks can view 1 part @ time. have section height part taken care of, i'm clueless on how call easing. research i've done relates sticky headers , sidebars. i'm not sure feature called!
here's jsfiddle: http://jsfiddle.net/y2utv/1/
here's js looks like:
$(window).resize(function(){ var windowheight = $(window).height(); $(.section).css(height, windowheight); });
you not passing jquery's css method variable declared. remove quotes around 'windowheight'
, should work right away.
$(window).resize(function(){ var windowheight = $(window).height(); $('div.section').css('height', windowheight); }); ^^^^^^^^^^^^ remove quotes
i can give basic idea on how should implement want
with issue, going need differently named div
s, you'll have single out each section
somehow. adding id
attribute easiest.
next, you'll need add event scroll()
moves top
of next div, whether or down either snap window position, or animate()
it.
you'll need way track current positioned section
can know move next during scroll()
event.
Comments
Post a Comment