Opção jQuery UI redimensionável minWidth
O jQuery UI consiste em widgets GUI, efeitos visuais e temas implementados usando jQuery, CSS e HTML. O jQuery UI é ótimo para construir interfaces de UI para páginas da web. A opção jQuery UI Resizable minWidth é usada para definir a largura mínima do elemento redimensionável.
Sintaxe:
$(".selector").resizable({ minWidth: width_val });
Link CDN: Primeiro, adicione os scripts de IU do jQuery necessários para o seu projeto.
<link rel = ”stylesheet” href = ”// code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css”>
<script src = ”// code.jquery.com/jquery- 1.12.4.js ”> </script>
<script src =” // code.jquery.com/ui/1.12.1/jquery-ui.js ”> </script>
Exemplo:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href=
"//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<script src=
"//code.jquery.com/jquery-1.12.4.js">
</script>
<script src=
"//code.jquery.com/ui/1.12.1/jquery-ui.js">
</script>
<style>
h1 {
color: green;
}
#first_div {
width: 150px;
height: 150px;
background: green;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
</style>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h3>jQuery UI Resizable minWidth Option</h3>
<div id="first_div">Div content</div>
<script>
$(function () {
$("#first_div").resizable({
minWidth: 100
});
});
</script>
</body>
</html>
Saída:
Referência: https://api.jqueryui.com/resizable/#option-minWidth
As postagens do blog Acervo Lima te ajudaram? Nos ajude a manter o blog no ar!
Faça uma doação para manter o blog funcionando.
70% das doações são no valor de R$ 5,00...
Diógenes Lima da Silva