jquery设置所匹配元素的宽度和高度
2013-01-26 13:58
239 查看
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs
/jquery/1.4.0/jquery.min.js"></script>
</head>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$(".id100").height("200px");
$("#id200").width("200px");
});
});
</script>
</head>
<body>
<div class="id100" style="background:yellow;height:100px;width:100px">
HELLO</div>
<div id="id200" style="background:yellow;height:100px;width:100px">
W3SCHOOL</div>
<button type="button">Click me</button>
</body>
</html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs
/jquery/1.4.0/jquery.min.js"></script>
</head>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$(".id100").height("200px");
$("#id200").width("200px");
});
});
</script>
</head>
<body>
<div class="id100" style="background:yellow;height:100px;width:100px">
HELLO</div>
<div id="id200" style="background:yellow;height:100px;width:100px">
W3SCHOOL</div>
<button type="button">Click me</button>
</body>
</html>
相关文章推荐
- jQuery设置指定网页元素宽度和高度的方法
- JQuery 设置元素的高度和宽度相等
- jquery获取与设置元素的宽度与高度
- jquery获取跟设置元素高度宽度
- jquery获取和设置元素高度宽度
- jQuery获取页面及个元素高度、宽度【转】
- jquery bootstrap 中的 模式对话框 modal 设置宽度和高度
- jquery 获取元素的 实际宽度和高度
- jquery outerHeight方法 outerWidth方法 获取元素实际宽度高度
- jquery根据图片宽度同比例设置图片高度,图片自适应高度
- JavaScript、jQuery获取页面及个元素高度、宽度
- JQUERY获取元素高度或宽度
- get新技能: 如何设置元素高度与宽度成特定比例。宽度改变,高度自动按比例改变。 例如设置宽高比16:9。
- jQuery获取页面及个元素高度、宽度
- jQuery获取页面及个元素高度、宽度
- jQuery获取元素位置以及高度与宽度
- jQuery来了--尺寸,返回/设置元素的宽高度
- display:block; 块级元素。<a>,<span>标签设置宽度和高度
- jQuery获取元素位置以及高度与宽度 动态调整打开新窗口效果
- jQuery获取页面及个元素高度、宽度的总结――超实用