I want to delay a link form loading on my page because I want the visitor to view the ads for a few seconds and then the link should appear. So how do i use Jquery to delay an ahref link from showing up?
If your HTML looked like this:
<a id="myLink" href="xxx">whatever</a>
Then, for plain javascript, you could use this CSS rule:
#myLink {visibility: hidden;}
And, then use this plain javascript to show it after a delay:
setTimeout(function() {
document.getElementById("myLink").style.visibility = "visible";
}, 5000);
Or, with jQuery, you could use this CSS:
#myLink {display: none;}
And this jQuery code:
$(document).ready(function() {
$("#myLink").delay(5000).fadeIn();
});
In either of these cases, you adjust the 5000 number to set the time delay you want (in milliseconds).
In the future, if you include your actual HTML, you will get much more detailed and specific answers.
With jQuery and no CSS:
$(window).load(function() {
$("#linkId").hide();
setTimeout(function() {
$("#linkId").show();
}, 10000);
});