PDA

View Full Version : Text Change Question


Mini
04-02-2010, 10:28 PM
Iím working on a web page in dreamweaver, this webpage is a catalog structure web page. Iím trying to figure out how to make the text change when a different product is clicked on, for instance when image 1 is clicked on I want it to say card 1, when image 2 is clicked on I want it to say card 2. Does any one have any suggestions on how to accomplish this?

gray67
04-03-2010, 02:05 AM
This can be accomplished using Javascript. I've included images of shirts to be clicked on to display alternate text.

<script type="text/javascript">

function productText1(){
document.getElementById('info').innerHTML = 'CARD 1';
}

function productText2(){
document.getElementById('info').innerHTML = 'CARD 2';
}

function productText3(){
document.getElementById('info').innerHTML = 'CARD 3';
}

</script>

<p> Click one of the images below for more product information</p>

<p id='info'>&nbsp</p>

<img src="http://bit.ly/duCymB"onclick='productText1()' />
<img src="http://bit.ly/aTKFwb" onclick='productText2()' />
<img src="http://bit.ly/9zjTha" onclick='productText3()' />

Mini
04-03-2010, 12:18 PM
I’m not sure how to use java script yet, it seems complicated, is there a way to use it in dreamweaver that is relatively simple. I’m not trying to get out of doing hard work, it’s just that at this point, where I am at currently I just need to know where to start. Can anyone point me in the direction to use through dreamweaver that will make this text change to occur?

gray67
04-07-2010, 10:48 AM
The only way that I know of for this to work is by using JavaScript. Once in Dreamweaver, click code view. Copy and paste the block of code above between the body tags and it should work. There might be a JavaScript plugin built into Dreamweaver for the text change you want but I'm not too familiar with such features in Dreamweaver.