页面的jQuery切换样式

时间:2018-11-07 15:58:03

标签: jquery css styles toggle

所以我有一个具有特定CSS样式的网页。我有一个按钮,单击该按钮可以使用jQuery更改页面的整个样式。效果很好,但是问题是当再次单击按钮时,我无法返回页面的先前样式。有什么建议吗?

这是jQuery代码:

$('#float').click(function(){
    $('#one').css({'transform':"rotate(45deg)",'top':'20px'});
    $('#two').animate({width:'0px'});
    $('#three').css({'transform':'rotate(-45deg)','top':'-10px'})
    $('.hide').css({'display':'none'});
    $('#left').animate({width:'33%'});
    $('#right').animate({width:'33%',left:'67%'});
    $('#middle').css({position:'relative'}).animate({top:'100px'})
})

0 个答案:

没有答案