The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to make a "Click me and i'm not invisible anymore!"

View previous topic View next topic Go down

Solved How to make a "Click me and i'm not invisible anymore!"

Post by Saxaca on September 29th 2010, 4:13 pm

Okay, you see these buttons, like "Click me"

Example:

Before clicking:

Click here to open!

After clicking:

Click here to close!

Blahblahblahblah


It's surely JavaScript. Anyone have the code?


Last edited by Saxaca on September 29th 2010, 8:50 pm; edited 1 time in total

Saxaca
Forumember

Male Posts : 539
Reputation : 26
Language : Markup.

Back to top Go down

Solved Re: How to make a "Click me and i'm not invisible anymore!"

Post by Vlajki on September 29th 2010, 7:30 pm

Something like spoiler? (click it)
Spoiler:
Very Happy

Vlajki
Forumember

Male Posts : 724
Reputation : 359
Language : Serbian & English
Location : Serbia

Back to top Go down

Solved Re: How to make a "Click me and i'm not invisible anymore!"

Post by Guest on September 29th 2010, 7:40 pm

Javascript:

Code:

<script type="text/javascript">
<!--
function resettoggle() {
var e = document.getElementById('toggle');
e.style.display = 'none';
}

function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//-->
</script>

<body onLoad="resettoggle()">
<a href="#" onclick="toggle_visibility('toggle');">Show / Hide</a>
<div id="toggle">I'm Gangstar15</div>
</body>

Try it here: http://www.w3schools.com/html/tryit.asp?filename=tryhtml_intro

Guest
Guest


Back to top Go down

Solved Re: How to make a "Click me and i'm not invisible anymore!"

Post by exterminator on September 29th 2010, 7:44 pm

Here you are :

Code:
<div align="center">
<input type=button value="Click here to Open!" style='width:200px;margin:0px;padding:0px;' onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';        this.innerText = ''; this.value = 'Close!'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Click here to Open!'; }"/>
</div>
<div style="min-height: 0px; background-color: #FFFFFF;">
<div style="display: none" align="center">



http://khoahoctunhien.2forum.biz



</div>
</div>

exterminator
Forumember

Male Posts : 106
Reputation : 4
Language : English, Japanese, Vietnamese, HTML, Javascript, C, C++, C#, VB.Net
Location : Hochiminh City - Vietnam

Back to top Go down

Solved Re: How to make a "Click me and i'm not invisible anymore!"

Post by Saxaca on September 29th 2010, 8:48 pm

Thanks all!

--> Solved

Saxaca
Forumember

Male Posts : 539
Reputation : 26
Language : Markup.

Back to top Go down

Solved Re: How to make a "Click me and i'm not invisible anymore!"

Post by ankillien on October 1st 2010, 10:56 am

Solved > Locked

ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

http://www.webartzforum.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum