search

Home  >  Q&A  >  body text

javascript - Click the button to make the div show and hide. There is animation. Click to show it but it cannot be taken back.

$(function(){
$(".span").click(function(){

$(".position").animate({left:'0'});
$('.postion').toggleClass('.blue');

});
$(".span").click(function(){

$(".blue").animate({left:'-360px'});

});
})

大家讲道理大家讲道理2774 days ago360

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-05-19 10:21:06

    By default .span{

    left: 100%;  // 默认是隐藏,可根据需求改变left的值
    -webkit-transition: left .5s cubic-bezier(0.1, 0.57, 0.1, 1);

    }

    When clicked to display, add a class or toggle to the element
    .page-slideLeft {

    -webkit-transition: left .5s cubic-bezier(0.1, 0.57, 0.1, 1);
    left: 0;

    }

    Finally, it’s not me who steps on you, I never step on others O(∩_∩)O~

    reply
    0
  • Cancelreply