-1

jQuery

$(document).ready(function () {
    $(".slideContent").animate({
        marginLeft: $(".slideContent").css('margin-left') == '903px' ?
            '0px' : '0px'
    }, function () {
        // Animation complete.
        $(".contentWrapper").css('z-index', '1');
    });

HTML

<div class="contentWrapper">
    <div class="content slideContent homeContent">
        <div class="content-text slideContentWrapper">    
        </div>
    </div>               
</div>

Right Now onload I did this. I do not want to reload page. I just want slide should happen on click.

4

1 回答 1

0
$(document).ready(function(){
  $("#id").click(function(){
    $(".slideContent").animate({        
      marginLeft : $(".slideContent").css('margin-left') == '903px' ? '0px' : '0px'                      
    }, function() {
      // Animation complete.
      $(".contentWrapper").css('z-index','1');
  });
});
于 2013-02-08T04:58:31.073 回答