【发布时间】:2015-06-17 18:56:15
【问题描述】:
我想让左栏在您单击它时变为 CSS left 10 动画,当我再次单击它时返回默认 CSS。
我试过这段代码:
$('.left-bar').click(function() {
$('.left-bar').toggle(function () {
$(this).animate({
// style change
left: "-116x"
}, 500);
}, function () {
$(this).animate({
// style change back
left: "-185px"
}, 500);
});
}
【问题讨论】:
-
在 Stackoverflow 上你不应该使用文字说话。用完整的单词写出完整的英语句子。
标签: jquery click jquery-animate toggle