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 fiddle

first, 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

class="lang-js prettyprint-override">$('body').scrollspy({ target: '#sidebar' })

then style lis hidden, override active 1 create visible:

class="lang-css prettyprint-override">#sidebar li { display: none; } #sidebar li.active { display: block; } screenshot:

jquery html image scroll fixed

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -