I am trying to slideDown() a hidden div but it only show() it without the slideDown() effect. when i clock on button content apears suddenly after 2-3 seconds here is js
var hash = window.location.hash.substr(1);
var href = $('#nav li a').each(function(){
var href = $(this).attr('href');
if(hash==href.substr(0,href.length-5)){
var toLoad = hash+'.html #content';
$('#content').load(toLoad)
}
});
$('#nav li a').click(function(){
var toLoad = $(this).attr('href')+' #content_id1';
$('#content').fadeOut(1000,loadContent);
window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
function loadContent() {
$('#content').load(toLoad,'',showNewContent())
}
function showNewContent() {
$('#content').slideDown('normal');
}
return false;
});
here is css
#content {width:934px;margin-top:238px;position:relative;height:500px;display:none;}
#content #content_id1{width:934px; background-color:white; height:500px; position:relative;top:4px;margin-top:238px;margin-bottom:50px;padding:20px;}
and here is html
<ul id="nav">
<li>
<a href="products/rania.php"><img src="img/products/1.jpg"/></a>
</li>
<li class="under">
<a href="products/lutron.php"><img src="img/products/2.jpg"/></a>
</li>
</ul>
<div id="content"> </div>
Read jQuery's API about slideDown()
. Where is no parameter as normal
, duration should be numeric value or slow
, or fast
.