Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Searching for a sniplet of code: Javascript maybe?

Custom Title Activated
Loyal Member
Joined
Mar 9, 2004
Messages
2,425
Reaction score
2
hello, im lookin for a sinplet of code tht can do the following

when the page is loaded there will be a link saying

*Dispay Comments* and once pressed it will reveal all comments, and once its pressed it will display a link called *Hide comments* where the display comments link was, this will hide the comments again

hope it aint confusing :p
 
Custom Title Activated
Loyal Member
Joined
Feb 27, 2004
Messages
1,378
Reaction score
50
u can do it in many ways.

but the easiest and the most cross platform is the style.display

which u can put on a div or layer ( pref: div ) and say
<div id=mydiv style="display:hide;">
..... all the html content ,,,,....
</div>

explain: wat happends is on page load the content will not be displayed.

then u create a button like
<input type=button value='show comments' onclick="something">

the basic javascript that manipulate is this

<script language="Javascript">
function java_show(id) {
elem = document.getElementById(id);
elem.style.display = 'block';
**
function java_hide(id) {
elem = document.getElementById(id);
elem.style.display = 'none';
**
</script>
 
Custom Title Activated
Loyal Member
Joined
Sep 7, 2004
Messages
1,886
Reaction score
5
I found this tutorial for you. Hope it helps ya...

 
Custom Title Activated
Loyal Member
Joined
Mar 9, 2004
Messages
2,425
Reaction score
2
ill give it ago, im not hiding html really, hiding php.. hope it dont cause any errors :S lol

worked :D thnks guys :p



Kampi~
 
Last edited:
Back
Top