Web Analytics Made Easy -
StatCounter animate function in jquery?? - CodingForum

Announcement

Collapse
No announcement yet.

animate function in jquery??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    Nobody please?

    Comment

    Working...
    X