Forum Moderators: open
I have been very impressed with Bernard's script here: [webmasterworld.com...]
It works well for a single group of divs but falters when there are more than one group.
Basically I want to be able to change a variety of div contents across a whole range of divs within one page
The HTML looks a little like this:
<div id="item-1"></div>
<ul>
<li><a href="#">item-1a</a></li>
<li><a href="#">item-1b</a></li>
<li><a href="#">item-2c</a></li>
</ul>
<div id="item-2"></div>
<ul>
<li><a href="#">item-2a</a></li>
<li><a href="#">item-2b</a></li>
<li><a href="#">item-2c</a></li>
</ul>
So the links 1a-1c & 2a-2c change the div contents of the corresponding div above.
Anyone got a script that will allow multiple div swapping?
Cheers, Limbo
function divFill( toId, fromId ) {
var fromDiv = document.getElementById( fromId );
document.getElementById( toId ).innerHTML = fromDiv.innerHTML;
} Just setup a bunch of hidden divs with the content you want to put into your main div. This way the content will still be spidered by the search engines.