Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2011
    Location
    Mauritius
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    animate function in jquery??

    Hi i have a code like this in my web site to slide a panel from left to right:
    <script type="text/javascript">
    <!--
    var sipPos = 0;
    $(document).ready(function() {


    $("#panel-tab").click(function(e) {
    //if(autoTimer) clearTimeout(autoTimer);
    //autoTimer = null;

    e.preventDefault();
    $("#panel").animate({ left: sipPos }, 1764, 'linear', function() {
    if(sipPos == 0) { sipPos = -856; }
    else { sipPos = 0; }

    });
    });
    });
    -->
    </script>

    ---CSS---

    #panel {
    width: 864px;
    height: 369px;
    position: absolute;
    top: 195px;
    left: -856px;/*-856*/
    z-index: 200;
    background:url('../images/bg_panel.png') no-repeat;
    padding:20px 0 0 18px;
    text-align:left;
    }
    #panel-tab {
    width: 21px;
    height: 371px;
    position: absolute;
    top: 9px;
    left: 856px;
    background:url(../images/panel-arrw-show.png) no-repeat;
    text-decoration: none;
    color: #FFFFFF;
    text-indent:-999999px;
    }

    What i want to do is use the animate function in jquery...like this $("#panel").animate({ left: 0 }) but not sure how to use that and on page load make the panel opens and stays open..

    Any help

    Sam

  • #2
    New Coder
    Join Date
    Aug 2011
    Location
    Mauritius
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Nobody please?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •