Welcome!

And don't forget to edit your signature & profile.

 

Icon

Statistics

  • Total posts 26748
  • Total topics 4864
  • Total members 6599
  • Our newest member
    efru

TOP POSTERS

toggle function help!

All problems related to JavaScript and AJAX are discussed and resolved here.
   

toggle function help!

Postby phips » Fri Aug 14, 2009 5:09 am

Hi, I'm trying to achieve this "toggle up and down events" effect on a website I'm building

http://ktn.globalwatchonline.com/epicen ... at/?mode=0

I guess it is using jquery, does anyone have any links to download-able code that uses this effect or something similar?

Please help! :cry:
phips
 
Posts: 3
Joined: Thu Aug 13, 2009 12:03 pm
   

   

Re: toggle function help!

Postby TT_Mark » Fri Aug 14, 2009 10:25 am

That is the code used on the site you linked to

Code: Select all


//Events
                //scroll down through events list
                $("#events_more").click(function(){
                    if ($("#cal").css("marginTop") != "-408px") {
                        $("#cal").animate({
                            "marginTop": "-=51px"
                        }, 450);
                    }
                    else {
                   
                    }
                });
               
                //scroll up through events list
                $("#events_back").click(function(){
                    if ($("#cal").css("marginTop") != "0px") {
                        $("#cal").animate({
                            "marginTop": "+=51px"
                        }, 400);
                    }
                });
User avatar
TT_Mark
Smashing <li>
 
Posts: 443
Joined: Tue Feb 10, 2009 6:27 am
Location: Sheffield, UK
   


Return to JavaScript & AJAX



Who is online

Users browsing this forum: No registered users and 2 guests