控制width设置动态效果注意事项

1、width的初始值设置

width的初始值设置为空,这样浏览器就不会渲染width;就不会影响其他效果;

element.style.width="";

2、动画方向的基点设置

当用width和height设置动态效果时,width和height的默认方向是从左往右,从上到下;
我们可以把该元素设置定位;
同时几点为:bottom:0;right:0;

element{display:absolute;bottom:0;right:0;}
发布了133 篇原创文章 · 获赞 0 · 访问量 1696

猜你喜欢

转载自blog.csdn.net/weixin_43269800/article/details/104703327