CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   jQuery Need element closed on load, visible on click. (http://www.codingforums.com/showthread.php?t=241419)

delonick 10-19-2011 03:05 PM

Need element closed on load, visible on click.
 
So this is probably a pretty elementary (stupid) question.
I have the below code which is displaying an expandable banner.
Right now it opens automatically for a split second on load.
When I remove the slideUp parameter, it loads in the open position.

How can I modify the below script so that when the banner loads, it's in the closed position, and will open on click?

Thank you in advance.
<script type='text/javascript' src='http://code.jquery.com/jquery-1.5.2.js'></script>
<script type='text/javascript'>
//<![CDATA[
$(function(){
setTimeout($('#mySlider').slideUp('fast'), 1);

$('#down').click(function() { $('#mySlider').slideDown('fast')});
$('#up').click(function() { $('#mySlider').slideUp('fast')});
});
//]]>
</script>

<div id="myTopConainer">
<label id="down">
<img src="http://cdn.impressionsmedia.biz/images/close1.jpg">
</label>
<div style="padding-top:40px;" id="mySlider">
<div style="background-image:url(http://cdn.impressionsmedia.biz/images/close2.jpg); height:259px; background-repeat:no-repeat">

<div style="width:164px; height:34px; position:relative; top:70px; left:740px;">
<a href="http://www.google.com" ><img style="border:0px; float: right;" src="http://cdn.impressionsmedia.biz/images/button2.jpg"></a>
</div>
<div style="width:164px; height:34px; position:relative; top:110px; left:740px;">
<a href="http://www.google.com"><img style="float: right; border:0px;" src="http://cdn.impressionsmedia.biz/images/button1.jpg"></a>
</div>
<div style="width:21px; height:24px; position:relative; top:135px; left:840px;">
<label id="up"><img style="float: right; padding-bottom:5px;" src="http://cdn.impressionsmedia.biz/images/ads/nepaphil/closeimage.jpg" alt="" width="21" height="24" /></label>
</div>
</div>
</div>
</div>
<div style="clear:both;">



</div>


All times are GMT +1. The time now is 05:33 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.