[英]How can i change my current code to set my div to a min-height instead of a height jQuery
Can someone help me to set my div to min-height
instead of a normal height. 有人可以帮我将div设置为
min-height
而不是正常高度。 Cause when I press Learn more button it will go over my div
cause the function is made for setting a height instead of equal height. 原因是当我按下了解更多按钮时,它将超过我的
div
原因是因为该功能用于设置高度而不是相等的高度。
$.fn.equalHeight = function() {
var maxHeight = 0;
return this.each(function(index, box) {
var boxHeight = $(box).height();
maxHeight = Math.max(maxHeight, boxHeight);
}).height(maxHeight);
};
http://jsfiddle.net/vVsAn/5505/ http://jsfiddle.net/vVsAn/5505/
Please check the following URL where your issue has been fixed. 请检查以下网址,该网址已解决您的问题。
CSS 的CSS
.equalheightz{
background-color:#fff;
padding:5px;
margin:5px;
}
.phide{
display:none;
}
h3{
font-size:25px;
color:#333;
padding-bottom:5px;
}
p{
color:#333;
padding-bottom:5px;
}
JS : JS:
$(document).ready(function() {
$('.blok1show').click(function(){
$(this).parent().find('.phide').slideToggle('fast');
});
});
http://jsfiddle.net/vVsAn/5506/ http://jsfiddle.net/vVsAn/5506/
You can get the CSS property by using: 您可以使用以下方法获取CSS属性:
$(".foo").css("min-height", function(){
return $(this).height();
});
You can save that to a variable or something. 您可以将其保存到变量或其他内容中。
$(#YOUR-DiV).style.minHeight = "100px";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.