Hi everybody,
I have used a little Javascript and created a countdown that initiates when the browser is loaded. I am now looking for some advice on how to modify or rewrite this code, so that the countdown only appears and proceeds as coded when I click on a link.
$(document).ready(function(){
$("a").click(function(event){
alert("Thanks for visiting!");
});
});
Obviously, a call to your function in place of the alert is the way to go here. But $("a")..... means it's waiting for a link to be clicked and it will call whatever function you choose.
Oh, that's an easy one....
put </script> at the end of your link to the google jquery library and then put an opening <script> above $(document).ready
When you link to a library, it has to be enclosed in it's own <script></script> tags. And it's fine to multiple script tags. All of your functions can go between one set of tags though.
Excellent.
However, I can't have this happening to my countdown when the link is clicked several times ...
Ohh wow, is there any way to fix this as well?
Edit:
I'm thinking in terms of making the link disappear once the link was clicked.
There is, but I don't have time to work it out right now. Possibly tomorrow. Send me a private message with your email address and if you have google talk, that would be great.