答案 0 :(得分:2)
您可以使用带有两个函数的jQuery toggle()
作为参数。 Documentation。它允许您定义两个或更多函数,以便在每次单击鼠标时循环显示。
$(document).ready(function()
{
//slide up and down when click over id #one
$("#one").toggle(
function()
{
$(".togglebox").height(200);
},
function()
{
$(".togglebox").height(100);
});
});