html - Change div content while scrolling using jQuery -
html - Change div content while scrolling using jQuery -
i have fixed div box on right, , want create page scrolls, content in box changes according content on left corresponds using need help because don't know how using jquery.
here illustration animation of mean:
this question shows very little way of effort, started, utilize bootstrap scrollspy , hide links without active
class.
if doesn't meet needs, please utilize starting point inquire more focused question in future.
demo in fiddlefirst, setup of section headers list items this:
class="lang-html prettyprint-override"><div id="sidebar"> <ul class="nav"> <li><a href="#content1">content 1</a></li> <li><a href="#content2">content 2</a></li> <li><a href="#content3">content 3</a></li> </ul> lorem ipsum </div>
then add together scrollspy page, targeting #sidebar
created
$('body').scrollspy({ target: '#sidebar' })
then style li
s hidden, override active 1 create visible:
#sidebar li { display: none; } #sidebar li.active { display: block; }
screenshot: jquery html image scroll fixed
Comments
Post a Comment