0

I need to set the display property of div to block giving a fade effect, fadein function does not change the display property of the div to block. So the div cant be seen. How can I do it?

$('lesson-'+tab).setStyle({
display: 'block'
});

<div id='lesson'>
</div>
user1425871
  • 149
  • 2
  • 5
  • 13
  • Divs already have display:block. Why would you need to change it? Is there some other relevant code? And: No, the "display" property is not animatable. – Bergi May 31 '12 at 11:54

1 Answers1

0

You can FadeIn an element whose property has been set to {display:none}

<div id='lesson'>
</div>

css:

#lesson{
    display:none;
    height:100px;
    width:100px;
    background-color:red;
}

jquery

$(document).ready(function(){
    $("#lesson").fadeIn(1000);
});

demo link http://jsfiddle.net/uttara/TnHbJ/

Uttara
  • 2,496
  • 3
  • 24
  • 35