Forum Moderators: open

Message Too Old, No Replies

show/hide text

those pesky layers

         

theonliest

12:45 pm on Nov 27, 2002 (gmt 0)

10+ Year Member



I'm trying to create an onclick event that will reveal some text on a page, ie you click the 'read more' text and another paragraph appears below, I've tried using a MM_showhide layers bit of script but that only works in IE, ideally something that uses a divs visibility with as little javascript as possible, only needs to work in 5+ browsers,
any ideas?

korkus2000

12:58 pm on Nov 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I believe the MM_showhide script is a macromedia function from Dreamweaver. I believe the MM stands for MacroMedia. Do you have Dreamweaver or are you using a text editor?

BlobFisk

1:03 pm on Nov 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could just use an onClick (or href="javascript:...") event that will toggle the visibility of the layer that you wish to display.

Since it's 5+ browsers you can use getElementByID and not worry about document.layers and document.all:

document.getElementById(id).style.visibility = "visible";

HTH