So here's my html:
<!DOCTYPE html>
<html>
<head></head>
<body>
<a id="x" href="#" style="position:fixed; top:0; right:10px;">Switch</a>
<div id="a">
<p>Huge paragraph 1</p>
</div>
<div id="b" style="display:none;">
<p>Huge paragraph 2</p>
</div>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script>
$('#x').click(function() {
$('#a').toggle();
$('#b').toggle();
return false;
});
</script>
</body>
</html>
The problem is that let's say I've scrolled midway thru paragraph 1, and then hit the switch link. So now I'm looking at paragraph 2. Let's say I do some scrolling on paragraph 2, then decide I want to switch back to paragraph 1, so I hit switch. Problem is that when I switch back to paragraph 1, I'm in a completely different spot then my original midway point. How can I get each div's scrolling to basically only scroll their own respective content so that if I were to switch I can still continue where I left off previously?