javascript - Add on scroll header effect / transition with position property -
I have a header in which But the problem is how do I use the header effect with the code: css js: < / P> HTML CSS JS So when the site loads (in css), in the header position on loading: full to fix it on a particular scroll This is working .. ..
position: fixed property (i.e. Along with)
.iaw-header {status: absoulte}
{If (jQuery (window) .scrollTop ()> = 700) {jQuery ('.a.w.-header'). CSS ('position', 'fixed'); }); }
& lt; Div id = "title" & gt; Here's the header text. & Lt; / Div & gt;
.header {status: absolute; }
if (jQuery (window) .scrollTop ()> = 700) {$ ('# header'). CSS ('top', '-300px'); $ ('# Header') CSS ('position', 'fixed'); $ ('# Header') Animate ({top: 0}, 1000); } And {$ ('top', 0); $ ('# Header') ({Top: '300 px'}, 1000, function () {$ ('# header'). '). CSS ('position', 'complete');); }
top: -300px; , and when the user scrolls up, you have the transition (or set)) to the header's top 0 px, so it scrolls down from the top.
Comments
Post a Comment