...

View Full Version : Javascript Background/Content Change Help



savagebeauty
07-31-2011, 08:38 PM
I have a div that changes background on click.
Example:

<script type="text/javascript">

function changeBackground(strURL)
{
document.getElementById('about').style.backgroundImage="url("+strURL+")";
}

</script>

<body>

<div id="about">
<a href="#about" onClick="changeBackground('mainbackground.jpg');">text</a>
<a href="#about" onClick="changeBackground('background2.jpg');">text</a>
</div>

This part works just fine so no issues.

However, I have content on the mainbackground.jpg that is getting transferred over to the other backgrounds as well.

I would like each background to have its own paragraph content. I do not want to embed the info into the images for SEO reasons.

Any ideas on how to do this?

Thanks!

VIPStephan
07-31-2011, 09:22 PM
A live example would help tremendously to understand what exactly you mean.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum