Forum Moderators: open

Message Too Old, No Replies

fold out with javascript?

         

helohelo

9:31 pm on Jan 19, 2004 (gmt 0)

10+ Year Member



hello,
I look for a way to display a questionmark button under some kind of submissionbutton. When pushing the questionmark button the page unfold and the explanation is showed, in the page, so no popup. Ihave seen it many times but cannot find it now. Please help!

Purple Martin

10:44 pm on Jan 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could use the onClick event of the question mark button to show a div that was previously hidden.

helohelo

10:52 pm on Jan 19, 2004 (gmt 0)

10+ Year Member



yes but is the other text then "pushed" down?
I dont think so, or is it?

Purple Martin

2:48 am on Jan 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I imagine it would be, but there's only one way to find out: try it and see!

helohelo

9:19 am on Jan 20, 2004 (gmt 0)

10+ Year Member



ok,
Iam a table rooky, more into layers.
Can you give me an example html of what you propose?
I would highly appriciate that!

Purple Martin

9:43 pm on Jan 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This isn't a table thing, it's a layer thing! (By layer I mean <div>, not the old N4 <layer>)...

...your div with the explanation should start off as hidden:

<div id="myDivID" style="visibility:hidden;">
Here is the explanation text.
</div>

...in the onClick of the button, call a JavaScript function:

onClick="showMyThing()"

...in the head of the document (inside script tags) you put your JavaScript function (the if statement is there because IE references objects with document.all whereas good browsers use document.getElementByID):

function showMyThing() {
if (document.all) {
document.all["myDivID"].style.visibility = "visible" // for IE
} else {
document.getElementByID("myDivID")"].style.visibility = "visible" // good browsers
}
}