i have single-page site 4 sections:
<section id=“4”> <section id=“3”> <section id=“2”> <section id=“1”> and want change order when scroll-up (the scrolling reverse , u can't scroll down). this:
<section id=“1”> <section id=“4”> <section id=“3”> <section id=“2”> can give me trick on how it?
not best answer solution question:
var lastscrolltop = 0; $(window).scroll(function(event){ var st = $(this).scrolltop(); if (st > lastscrolltop){ // code when scrolled down } else { $("#content").html(''); $("#content").html(' <section id="1"></section><section id="4"></section><section id="3"></section><section id="2"></section>'); } lastscrolltop = st; }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="content" style="min-height:1220px"> <section id="4"></section> <section id="3"></section> <section id="2"></section> <section id="1"></section> </div>
Comments
Post a Comment