So I was wondering how you would do this.
I have a code that looks like this:
<body>
<div class="header">
</div>
<div class="content">
<div class="001">
Content
</div>
<div class="002">
Content
</div>
<div class="003">
Content
</div>
</div>
</body>
And my jQuery works like this :
jQuery('.001').click(function(){
jQuery(this).load('pages/001.html');
});
So what I would like is too add a line saying that if i click on another div (002 for example) to unload / go back to divs 001 state.
How would you achieve this ?
I was thinking of varing the contant at the beginning of the jQuery code and reloading it before each load, but I don’t know if this is optimal.
Any ideas / tips ?
Thanks !
If your loaded pages does not contain so much complex data, such as images, videos, etc. Use hide() and show() instead of loading html inside a div and loosing the previous state. If you use it for different purpose, create another div, make it invisible, and store your previous state content inside it, Thus you can swap whenever you want in that case.