这对我没有任何意义。
我正在尝试使用 jquery .css() 根据窗口高度设置某些按钮的“最小高度”。
不管出于什么原因,它只是设置了第一个按钮匹配的最小高度,但是有 16 个匹配按钮。
http://jsfiddle.net/VDtgT/20/embedded/result/
“#tab-btn-2”是问题所在。这是我正在使用的 javascript:
<script>
$( document ).ready( function(){
setMaxHeight();
$( window ).bind( "resize", setMaxHeight );
function setMaxHeight() {
$( "#tab-content-1" ).css( "max-height", ( $( window ).height() * 0.67 | 0 ) + "px" );
$( "#tab-content-1" ).css( "min-height", ( $( window ).height() * 0.67 | 0 ) + "px" );
$( "#tab-content-2" ).css( "max-height", ( $( window ).height() * 0.67 | 0 ) + "px" );
$( "#tab-content-2" ).css( "min-height", ( $( window ).height() * 0.67 | 0 ) + "px" );
$( "#tab-content-3" ).css( "max-height", ( $( window ).height() * 0.67 | 0 ) + "px" );
$( "#tab-content-3" ).css( "min-height", ( $( window ).height() * 0.67 | 0 ) + "px" );
$( "#tab-btn-2" ).css( "min-height", ( $( window ).height() * 0.67 | 0 ) + "px" );
}
});
</script>