| | |
Clicked Link Countdown
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
Originally Posted by tgreer
To further enhance your script, research JavaScript arrays. As each link is clicked, you could store it's ID in an array. Then, check to see if the current ID (x.id) is alreadly in the array. If it is, they've already clicked that link. Change the text to read "please click a different link" or something like that.
You can also remove links they've already clicked. Check into "CSS visibility".
If yes, how do I have 3 functions in one OnClick?
If no, please help.
Sorry I'm stupid :o
Martin
How do insert the css visibility command?
I tried putting it straight into javascript but this didn't work:
and
but this didn't work - how would I do this?
Thanks
Martin
I tried putting it straight into javascript but this didn't work:
HTML and CSS Syntax (Toggle Plain Text)
<script type="text/javascript"> function visibility() { visibility: hidden } </script>
HTML and CSS Syntax (Toggle Plain Text)
<a href="#" id="link_04" onclick="visibility();return link_click(this);">Search Engine</a><br />
Thanks
Martin
•
•
•
•
Originally Posted by tgreer
CSS declarations don't go in your scripts. They are in a separate "style" section entirely. However, your script can change a style.
HTML and CSS Syntax (Toggle Plain Text)
<script language="JavaScript"> function toggleVisibility(me){ if (me.style.visibility=="hidden"){ me.style.visibility="visible"; } else { me.style.visibility="hidden"; } } </script>
And in the body I've got:
HTML and CSS Syntax (Toggle Plain Text)
<a href="#" id="link_04" onclick="toggleVisibility(this)" style="position:absolute">Search Engine</a>
Is it possible to remove the space it took up when it was visible aswell?
OK - Ignore the previous post.
I just worked it out!
In the head I put:
And in the Link I put:
WOW - I'm quite proud of myself for working that out!
Thanks for all your help in this thread tgreer!:lol:
Martin
I just worked it out!
In the head I put:
HTML and CSS Syntax (Toggle Plain Text)
<script language="JavaScript"> function toggleDisplay(me){ if (me.style.display=="none"){ me.style.display="inline"; } else { me.style.display="none"; } } </script>
HTML and CSS Syntax (Toggle Plain Text)
<a href="http://www.google.com" id="link_04" onclick="toggleDisplay(this);return link_click(this);" style="display:block">Search Engine</a>
WOW - I'm quite proud of myself for working that out!
Thanks for all your help in this thread tgreer!:lol:
Martin
•
•
•
•
Originally Posted by tgreer
Note, though, that completely removes the link, instead of just making it invisible. A subtle difference. Try using "style.visibility=visible" and "style.visibility=hidden" instead. Compare the differences, and decide which you'd like to use, "visibility" or "display".
Thanks again
Martin
![]() |
Other Threads in the HTML and CSS Forum
- Previous Thread: Code to Hide TaskBar etc?
- Next Thread: CSS Fixed Background
Views: 4647 | Replies: 19
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
2002 appointments asp background backgroundcolor beta browser bug calendar cart center cgi code codeinjection corporateidentity create css deleted design development displayimageinsteadofflash dreamweaver drupal emailmarketing epilepsy explorer firefox flash font fonts form format free frontpage google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft missing mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. templates textcolor theme timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 wordpress xml xsl






