Skip navigation
Currently Being Moderated

(jQuery) Modifying slideUp & slideDown to slide left and right...

Aug 2, 2012 3:00 PM

Tags: #jquery #javascript #css

From the tutorial :
http://www.randomsnippets.com/2011/04/10/how-to-hide-show-or-toggle-yo ur-div-with-jquery/

 

function slideonlyone(thechosenone) {

     $('.newboxes2').each(function(index) {

          if ($(this).attr("id") == thechosenone) {

               $(this).slideDown(200);

          }

          else {

               $(this).slideUp(600);

          }

     });

}

 

This slides down (in) and up (out).

 

I'd like to slide left/right instead.

 

I'm assuming I'd have to use "animate" to pull this off.

 

Anyone know what the proper syntax would be?

 
Replies
  • Currently Being Moderated
    Aug 3, 2012 8:26 AM   in reply to jyeager11

    You would have to look in the guts of jQuery and see if there is a slideLeft() and a slideRight() function somewhere.  I'm sure there must be since they do such slides in the various slideshow demos.  Offhand, I don't know any more about it, but that is the first step I would take.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 8:45 AM   in reply to jyeager11

    You would only modify the existing code by changing 'slideUp(600)' with 'slideLeft(600)' - as an example - if such functions existed.  What you'd have to find in the actual jQuery codebase (i.e., NOT this initialization code that you show) would be those functions. I'm sure that they must exist....

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 11:07 AM   in reply to jyeager11
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points