1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

jQuery: Slide Left to Right

Discussion in 'jQuery' started by cancer10, Feb 2, 2009.

  1. #1
    Hi,

    I know how to Slide a DIV from top to bottom and vice-versa. The following code shows how to do it:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
    <script>
    $().ready(function(){
    				   $("#clicky").click(function(){
    					$("#slide").slideToggle("slow");						   
    											   });
    				   
    				   });
    </script>
    
    <input name="" type="button" value="Click me" id="clicky"/>
    <div id="slide">
    <h1>Hello World!</h1>
    </div>
    Code (markup):

    Question: Is there anyway I can slide a DIV from left to right and vice-versa?

    Please help.


    Thanx in advance
     
    cancer10, Feb 2, 2009 IP
  2. proxywhereabouts

    proxywhereabouts Notable Member

    Messages:
    4,027
    Likes Received:
    110
    Best Answers:
    0
    Trophy Points:
    200
    #2
    I do a google search and found this.
    http://answers.yahoo.com/question/index?qid=20081219045029AAkwyql


    "All you have to do is to add a toggle action, and add inside the animate action:

    $("#tmenu").toggle(function(){$('#sbco... -getWidth}, 0);}, function(){$('#sbcont').animate({left: +getWidth}, 0);});
    });
    PHP:
    for more information take a look in the API of jquery =P"
     
    proxywhereabouts, Feb 2, 2009 IP
  3. cancer10

    cancer10 Guest

    Messages:
    364
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Does not work :(
     
    cancer10, Feb 3, 2009 IP