...

View Full Version : Adding Description To Posted JavaScript Slideshow



Markxxx
10-19-2005, 04:44 AM
I am just learning JavaScript so I need some help or just to know if this is possible.

On this site is an awesome JavaScript for a onMouseover slideshow. I got it to work beautifully

onMouseover Slideshow Link (http://www.javascriptkit.com/script/script2/rolldifferent.shtml)

Here's what I'd like to do. When The mouse goes over the link it displays the photo in column two. I'd like to put in a third column, (that is easy enuff :) ) and in that third column would be a description of the photo.

Is this possible?

If so any clue how to best go about it. I've tried a couple of different things but I am lost here at how to best approach it

Thanks

rlemon
10-19-2005, 05:06 AM
where you want the text to appear put this:

<span id='mnu_text'></span>

when you want to change the text in it you use .innerHTML

like so..

var e = document.getElementById('mnu_text');
e.innerHTML = "this is the new text";

then, onMouseOut you simply

var e = document.getElementById('mnu_text');
e.innerHTML = "";

Markxxx
10-19-2005, 06:06 PM
Thanks for the response

Still not getting it. It probably is a little advanced for me

Is there a way you could use the script to let see an example? Or another way?

Sorry for being a pain.. Off to the library to get a javascript book

rlemon
10-19-2005, 06:59 PM
<html>
<head>
<script>

function toggleDesc(text){
var e = document.getElementById('DescriptionText');
e.innerHTML = text;
}

function resetDesc(){
var e = document.getElementById('DescriptionText');
e.innerHTML = '';
}

</script>
</head>
<body>
<a href="#" onMouseOver="toggleDesc('this is the new description')" onMouseOut="resetDesc()">this is a link</a>
<br /><br />
<span id="DescriptionText"></span>
</body></html>

Markxxx
10-28-2005, 03:27 AM
<html>
<head>
<script>

function toggleDesc(text){
var e = document.getElementById('DescriptionText');
e.innerHTML = text;
}

function resetDesc(){
var e = document.getElementById('DescriptionText');
e.innerHTML = '';
}

</script>
</head>
<body>
<a href="#" onMouseOver="toggleDesc('this is the new description')" onMouseOut="resetDesc()">this is a link</a>
<br /><br />
<span id="DescriptionText"></span>
</body></html>


Works out great. Thanks for the help guys. Sorry for the delay in the thanks

:D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum