How can i show a div onload and hide it in few seconds. Can you please help me out
developerhusain
How can i show a div onload and hide it in few seconds. Can you please help me out
developerhusain
Example:Code:$(function() { $("#testdiv").delay(2000).fadeOut(0); });
In testing I used a local copy of jQuery because the google hosted version wasn't working for some reason.HTML Code:<!DOCTYPE html> <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript"> $(function() { $("#testdiv").delay(2000).fadeOut(0); }); </script> </head> <body> <div id="testdiv">Test</div> </body> </html>
You might want something more elaborate, like:
http://www.dynamicdrive.com/dynamici...stickynote.htm
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
developerhusain (05-25-2013)
If you use the URL to the Google hosted jQuery without the protocol:
the page must be live. For local testing you can use:Code:<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
Right now Google is hosting that version. But you also have to make sure they are hosting any particular version you want before relying upon them for it.Code:<script src="http//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
As far as I can tell, they are not currently hosting 2.0.1, which is the latest, nor 1.10.0, both of which are available on the jQuery home page.
Interestingly though jQuery is now offering both 2.0.1 and 1.10.0 for download, on their api docs page and home page, they're still using 1.9.1.
This is a lot of versions and a lot of changes all at once, even for jQuery. I think that they're moving a little too fast, or should have just waited till version 2 to make so many changes and skipped 1.9+ in the 1 series. But it's up to them what they want to do. Hopefully once the transition to version 2 is well established, the dust will settle to a certain extent.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Bookmarks