我在使用 Zurb 基础的页面上的 CSS 页面上有这个类。
.brandingOpen{
height:2044px;
}
我有一个 id 为的按钮
#zoomBranding
,到目前为止,我已经尝试过了,但没有任何结果。
$("zoomBranding").click(function(){
$("#branding").toggleClass("brandingOpen");
}
);
根本不工作,如果我发出警报,这很好用,但 toggleClass 不行。
到目前为止,我已经尝试了这个结果,但只有一次:
$(document).ready(function(){
$("#zoomBranding").click(function(){
$(this).toggleClass( function(){
$("#branding").css("height", "2044px");
$(this).addClass("fi-zoom-out");
$(this).click( function(){
$("#branding").css("height", "1044px");
});
}
);
}
);
}
);
我不能在#branding 中使用类,即使使用 .addClass 所以如果有人知道我做错了什么,请帮助我。
使用 Foundation 4 中已经包含的查询版本,甚至尝试在所有内容的顶部使用 jquery-migrate,都是相同的结果。
这是#branding的CSS。
#branding{
height:1044px;
overflow:hidden;
-webkit-transition: height 0.5s linear;
-moz-transition: height 0.5s linear;
transition: height 0.5s linear;
}
.brandingOpen{
height:2044px;
}