#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    100
    Rep Power
    0

    Toggle then fadeOut


    Code:
    function toggle(element,speed){
    	$(element).toggle(speed);
    			}
    Code:
    <a href="#" class="ques" onClick="toggle('#ans1',800)">Is javascript a OOP language<</a>
    
    <div id="ans1" style="display:none;">Yes, Its a OOP language but in a different Style ! </div>
    I want that function to make my div toggle(showup) then second click it FadesOut. I dont want it to slide back. What i do
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,187
    Rep Power
    184
    Since you do not want the slide effect; you may not want to use the .toggle() API; but instead..., you may want use the .fadeIn() & .fadeOut() APIs. Those two APIs should give you the effect your looking for.

IMN logo majestic logo threadwatch logo seochat tools logo