Old 03-05-2008, 17:36   #1 (permalink)
thastrom
Registered User
 
Join Date: Feb 2008
Posts: 51
How do I make it one button?

how do I make this one button ? It's one slide down and one slide up button now I want just one that does both.

Here's the code:

Code:
<a href="#" onclick="Effect.BlindUp('d1');; return false;" >Slide Down</a> <a href="#" onclick="Effect.BlindDown('d1');; return false;">Slide Up</a>
  Reply With Quote
Old 03-05-2008, 18:01   #2 (permalink)
xENo
Jack of all trades
 
xENo's Avatar
 
Join Date: May 2008
Location: Orange County, CA
Posts: 51
Send a message via AIM to xENo Send a message via Yahoo to xENo
The code doesn't really make sense out of context like that.

Do you have a link?
  Reply With Quote
Old 03-05-2008, 18:29   #3 (permalink)
thastrom
Registered User
 
Join Date: Feb 2008
Posts: 51
how about now ?

Code:
<div class="style11" id="d1" style="display:none;"> <span class="style14">E-mail:</span> text1 <span class="style14">Msn:</span> text2 <span class="style14">AIM:</span> text3</div> <div align="center"><span class="style11"><a href="#" onclick="Effect.BlindUp('d1');; return false;" >Slide Down</a> <a href="#" onclick="Effect.BlindDown('d1');; return false;">Slide Up</a></span> </p> </div
  Reply With Quote
Old 03-05-2008, 21:38   #4 (permalink)
xENo
Jack of all trades
 
xENo's Avatar
 
Join Date: May 2008
Location: Orange County, CA
Posts: 51
Send a message via AIM to xENo Send a message via Yahoo to xENo
We're gettin there. Where's the rest of the javascript?

A lot of times these things can be simple syntax errors, and people don't even paste the problem... so its hard to see without a link to a full page.
  Reply With Quote
Old 04-05-2008, 04:24   #5 (permalink)
thastrom
Registered User
 
Join Date: Feb 2008
Posts: 51
Now ?

Code:
<script src="javascripts/prototype.js" type="text/javascript"></script> <script src="javascripts/scriptaculous.js" type="text/javascript"></script> <style type="text/css" media="screen"> /* <![CDATA[ */ #d1 { background-image: url(BG-Svart.png); width: 190px; } /* ]]> */ </style> <div class="style11" id="d1" style="display:none;"> <span class="style14">E-mail:</span> Text1 <span class="style14">Msn:</span> Text2 <span class="style14">AIM:</span> Text3</div> <div align="center"><span class="style11"><a href="#" onclick="Effect.BlindUp('d1');; return false;" >Slide Down</a> <a href="#" onclick="Effect.BlindDown('d1');; return false;">Slide Up</a></span> </p>

sorry I don't have a link.
  Reply With Quote
Old 04-05-2008, 04:36   #6 (permalink)
xENo
Jack of all trades
 
xENo's Avatar
 
Join Date: May 2008
Location: Orange County, CA
Posts: 51
Send a message via AIM to xENo Send a message via Yahoo to xENo
Ok, the easiest way would be to have both of those, but hide one and show the other... then when it changes, show one and hide the other.

You can do that by wrapping each in their own element, like a span with an id. Then hide one by default with a CSS class. When you click the one thats shown, change the class on the hidden one to make it show up, and then change the class on the one you clicked to hide it. They should appear to be just one link that updates.

Something like this... this may not work but it should help to get you close.

Code:
<style> .hidden { display: none; } </style> <div align="center"> <span id="downlink" class="style11"><a href="#" onclick="Effect.BlindUp('d1'); $( 'downlink' ).addClassName( 'hidden' ); $( 'uplink' ).removeClassName( 'hidden' ); return false;" >Slide Down</a></span> <span id="uplink" class="style11 hidden"><a href="#" onclick="Effect.BlindDown('d1'); $( 'downlink' ).removeClassName( 'hidden' ); $( 'uplink' ).addClassName( 'hidden' ); return false;">Slide Up</a></span> </div>
  Reply With Quote
Old 04-05-2008, 08:53   #7 (permalink)
thastrom
Registered User
 
Join Date: Feb 2008
Posts: 51
yep, it worked ! thanks !
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8