This works great:
$(document).ready(function() {
var previewwidth = ($(window).width() - ( $('.aside').width() + $('.results').width() + 110) ) ;
$(".result-preview").width(previewwidth);
$("footer").text(previewwidth);
});
$(window).resize(function() {
var previewwidth = ($(window).width() - ( $('.aside').width() + $('.results').width() + 110) ) ;
$(".result-preview").width(previewwidth);
$("footer").text(previewwidth);
});
but I'm not sure how to set min and max width, so min-width to 338px and max-width to 500px.
thanks!
Dialog minWidth option is used to set the minimum width that can be set to the dialog box in pixels. By default, the value is 150.
width("20%") however the element kept getting set to width: 24% . After digging through the docs, turns out this is related to the CSS box-sizing property. Using . css({'width':"20%"}) will avoid this adjustment.
The innerWidth() method returns the inner width of the FIRST matched element.
$(".result-preview").css({
"min-width": "338px",
"max-width": "500px"
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With