我用 jQuery
制作了一个可扩展的 div
所以在我的 css 中 div
是 250px
宽度,当我将其展开为 500px
。
如何让它响应?我的意思是,当 div
处于“打开”状态时,我想要它以便当用户调整其窗口大小时 div
会随之调整大小,并且当用户单击 open
在它打开的 div 上取决于窗口的
尺寸。
这是我的代码:
$('.button').click(function(){
$('.content').animate({width: "500px",}, 500);
setTimeout(function(){
$('.content').animate({top: "-400px", marginBottom: "0px", height:"1000px"}, 500);
},500);
});
.content{
width:250px;
}
最佳答案
.content{
width:50%;
}
调整宽度:)
关于javascript - 在javascript中响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30448702/