views:
52answers:
5That is correct as long as you make sure the elements exists when the code runs.
$(function() {
$('div.sc_menu').hide().delay(2000).fadeIn('slow');
});
EDIT: Made it so that the fadeIn()
will wait 2 seconds before running. You need to be using jQuery 1.4 or later to do this.
This will make sure the document is loaded before the .fadeIn()
fires.
EDIT:
This appears to be the code from the link you provided.
$(function () {
.load(function () {
// set the image hidden by default
$('#div.sc_menu').hide();.fadeIn(3000);
}}
It is malformed on several levels. Be sure to post your actual code in your question. Always helps to get the best solution.
Maybe its my computer.... its never done this. Regardless do you like the design of the theme?
CSS:
div.sc_menu { display: none; }
JQUERY:
$(document).ready(function(){$('div.sc_menu').fadeIn('slow');});
Also, I am using jquery 1.4.2
$(function() { $('div.sc_menu').hide().fadeIn('slow'); });Hmmm. The code seems OK to me. Try removing the "display:none;" from the CSS, to make sure that your DIV is positioned where you want it to, not overlapped by another DIV, or not off to the wrong side, or perhaps at 0 width or 0 height.
Firebug plugin for Firefox is also another great tool to observe changes to the DOM on the fly.