jquery动态改变div宽度和高度
2015-02-09 14:33
477 查看
效果体验:http://keleyi.com/keleyi/phtml/jquery/23.htm
完整代码:
参考:
http://keleyi.com/a/bjac/e753bc9c582e4fb0.htm
http://keleyi.com/a/bjad/yy8jnwqj.htm
web前端资源:
/article/4797642.html
完整代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>jquery动态改变div宽度和高度-柯乐义</title> <script type="text/javascript" src="http://keleyi.com/keleyi/pmedia/jquery/jquery-1.11.2.min.js"></script> </head> <body> <div> <input id="addwidthkeleyi" value="增加宽度" type="button" /> <input id="reducewidthkeleyi" value="减少宽度" type="button" /> <input id="addheightkeleyi" value="增加高度" type="button" /> <input id="reduceheightkeleyi" value="减少高度" type="button" /> <a href="http://keleyi.com/a/bjad/tar6g4m7.htm" target="_blank">原文</a> <a href="http://keleyi.com/">首页</a> <a href="http://keleyi.com/keleyi/phtml/">特效库</a> 点击按钮,注意下方div宽高的变化</div> <div style="border:1px solid #999;width:200px;height:200px" id="keleyidiv"></div> <script type="text/javascript"> $("#addwidthke"+"leyi").on("click", function () { $("#keleyidiv").width($("#keley" + "idiv").width() + 50); }); $("#reducewidthk" + "eleyi").on("click", function () { $("#keleyidiv").width($("#kel"+"eyidiv").width() - 50); }); $("#addheightkele" + "yi").on("click", function () { $("#kel" + "eyidiv").height($("#keleyidiv").height() + 50); }); $("#reduceheightkeley" + "i").on("click", function () { $("#keleyidiv").height($("#keleyidiv").height() - 50); }); </script> </body> </html>
参考:
http://keleyi.com/a/bjac/e753bc9c582e4fb0.htm
http://keleyi.com/a/bjad/yy8jnwqj.htm
web前端资源:
/article/4797642.html
相关文章推荐
- jquery实现动态改变div宽度和高度
- jquery动态改变div宽度和高度
- jquery动态改变div宽度和高度
- jquery动态改变div宽度和高度
- jquery实现动态改变div宽度和高度
- 调用jquery的resize方法改变div的宽度和高度在IE中不变,在谷歌中可以正常显示
- JQuery 动态改变图片尺寸,不论宽度和高度单方面超出给定数值,IE6、IE7、IE8下正常
- 浏览器窗口大小改变时,动态改变div高度和宽度
- 如何自动在html页面加载时动态改变div等元素的高度和宽度
- 调用jquery的resize方法改变div的宽度和高度在IE中不变,在谷歌中可以正常显示
- jquery动态修改div高度
- jquery实现div自适应浏览器高度(宽度)
- jquery入门 动态调整div大小,使其宽度始终为浏览器宽度
- jQuery实现动态分割div—通过拖动分隔栏实现上下、左右动态改变左右、上下两个相邻div的大小
- img超出div width时, jQuery动态改变图片显示大小
- jQuery获取元素位置以及高度与宽度 动态调整打开新窗口效果
- 【微信小程序教程】动态改变view标签的宽度和高度
- IOS笔记UI--固定宽度,根据内容动态改变高度
- jquery动态调整div大小使其宽度始终为浏览器宽度
- jQuery实现鼠标拖动改变Div高度