Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-19-2011, 03:05 PM   PM User | #1
delonick
New to the CF scene

 
Join Date: Oct 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
delonick is an unknown quantity at this point
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>
delonick is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:12 AM.


Advertisement
Log in to turn off these ads.