offset--BUG
offsetWidth所获取的宽度并不是div的实际宽度,它包括div的width、border等。
在JS函数中,可以通过obj.style.width来获取div的实际宽度,但是这种方式style只能获取行间样式,所以需要一个函数调用css中样式,代码如下:
function getStyle(obj, name) {
if (obj.currentStyle) {
return obj.currentStyle[name];
}
else {
return getComputedStyle(obj, false)[name];
}
} setInterval(function () {
var oDiv = document.getElementById('div1'); oDiv.style.width = parseInt(getStyle(oDiv, 'width')) - 1 + 'px';
}, 30);
现在我们来用一个案例来掩饰去掉offset如何实现 代码:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
div {
width: 200px;
height: 200px;
margin: 20px;
float: left;
background: yellow;
border: 10px solid black;
font-size: 14px;
}
</style>
<script>
window.onload = function () {
var oDiv1 = document.getElementById('div1'); oDiv1.onmouseover = function () {
startMove(this, 'height', 400);
};
oDiv1.onmouseout = function () {
startMove(this, 'height', 200);
}; var oDiv2 = document.getElementById('div2'); oDiv2.onmouseover = function () {
startMove(this, 'width', 400);
};
oDiv2.onmouseout = function () {
startMove(this, 'width', 200);
}; var oDiv3 = document.getElementById('div3'); oDiv3.onmouseover = function () {
startMove(this, 'fontSize', 50);
};
oDiv3.onmouseout = function () {
startMove(this, 'fontSize', 14);
}; var oDiv4 = document.getElementById('div4'); oDiv4.onmouseover = function () {
startMove(this, 'borderWidth', 100);
};
oDiv4.onmouseout = function () {
startMove(this, 'borderWidth', 10);
};
}; function getStyle(obj, name) {
if (obj.currentStyle) {
return obj.currentStyle[name];
}
else {
return getComputedStyle(obj, false)[name];
}
} function startMove(obj, attr, iTarget) {
clearInterval(obj.timer);
obj.timer = setInterval(function () {
var cur = parseInt(getStyle(obj, attr)); var speed = (iTarget - cur) / 6;
speed = speed > 0 ? Math.ceil(speed) : Math.floor(speed); if (cur == iTarget) {
clearInterval(obj.timer);
}
else {
obj.style[attr] = cur + speed + 'px';
}
}, 30);
}
</script>
</head> <body>
<div id="div1">变高</div>
<div id="div2">变宽</div>
<div id="div3">字体变大</div>
<div id="div4">边框变粗</div>
</body>
</html>
运行结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABPAAAAErCAIAAADfYOofAAAXrUlEQVR4nO3a3W6jV86tUd//TTsHEzAMy/pxKFJcqjHw4EOSrlRSyZrc/W70xycAAAAc6OPVfwMAAADwf/igBQAA4Eg+aAEAADiSD1oAAACO5IMWAACAI/mgBQAA4Eg+aAEAADiSD1oAAACO5IMWAACAI/mgBQAA4Eg+aAEAADiSD1oAAACO5IMWAACAI/mgBQAA4Eg+aAEAADiSD1oAAACO5IMWAACAI/mgBQAA4Eg+aAEAADiSD1oAAACO5IMWAACAI1U/aD9gmacMwxZ4A7YAYQsQr9oCtPJBy7t5yjBsgTdgCxC2APGqLUArH7S8m6cMwxZ4A7YAYQsQr9oCtPJBy7t5yjBsgTdgCxC2APGqLUArH7S8m6cMwxZ4A7YAYQsQr9oCtPJBy7t5yjBsgTdgCxC2APGqLUArH7S8m6cMwxZ4A7YAYQsQr9oCtPJBy7t5yjBsgTdgCxC2APGqLUArH7S8m6cMwxZ4A7YAYQsQr9oCtPJBy7t5yjBsgTdgCxC2APGqLUCr3g/az0/p+e081rag+WxBSrYgpZ1bgFbVl/2nY/34+XbodaOdx9oWNN8/soUfP+bun/Kn1ZjYe/QGW/j6hdz4Nf6PfyxP+TE6qJ1bgFbVl/3XY/343XRhda2dx9oWNN8/soWPP37QPvhj/vojtblDt3D5/G48yK//6PFx3f4JL3/AIz+hlrdzC9Cq+rLv7OYxj/80Lz8T2tC9R/IaxRV8vfDHf6R075GcvYXvv8wbv/v4X/DaP8OX/3tUvXv/6jdu4evv/Mcv5Mav8ZEf8+AWfvxsHxcf2KZxaDu3AK2qL/uRY/01sF9/W/prO4/1s7bwyDosSOnELfz1hX983PnFPvLnPvjX0rmduIWvv/MbP/Dar+7yD/76z+TX3/7xBy//Zm78Kdrfzi1Aq+rL/tOx/j62z+vn9drPI6Wdx/pZW/jrb+tf7sQtPPJ6b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dgCxC2APGqLUArH7S8m6cMwxZ4A7YAYQsQr9oCtPJBy7t5yjBsgTdgCxC2APGqLUArH7S8m6cMwxZ4A7YAYQsQr9oCtPJBy7t5yjBsgTdgCxC2APGqLUArLxsAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj+aAFAADgSD5oAQAAOJIPWgAAAI7kgxYAAIAj/Qc6MU3tyb9eQAAAAABJRU5ErkJggg==" alt="" />
offset--BUG的更多相关文章
- kbmmw 5.01 发布
Important notes (changes that may break existing code) ============================================= ...
- kbmmw 5.0 beta1 发布
经过大半年的等待,kbmmw 的新版终于来了.经过近5年的打磨, kbmmw 的版本号升级到5了. kbmMW is a portable, highly scalable, high end app ...
- Sql 2012 OFFSET / FETCH NEXT BUG
上个星期,测试发现了一个分页的bug--- 无论怎么分页数据的一样.我们所有的分页都是用EF 分页,为什么只有一个模块的分页有问题呢? 后来跟了下sql语句,发现用到是sql2012的新分页方式 OF ...
- Javascript 运动中Offset的bug——逐行分析代码,让你轻松了解运动的原理
我们先来看看这个bug 是怎么产生的. <style type="text/css"> #div1 { width: 200px; height: 200px; bac ...
- JS 中offset 的小bug 与解决方案。
一.发现bug准备工作,先定义一个div,然后给div加上样式 效果图如图所示: 二.编写正常的代码,同时给div加上一个id 会发现div图会向左缩进...直至消失. 三.添加代码bo ...
- [更新设计]跨平台物联网通讯框架ServerSuperIO 2.0 ,功能、BUG、细节说明,以及升级思考过程!
注:ServerSuperIO 2.0 还没有提交到开源社区,在内部测试!!! 1. ServerSuperIO(SSIO)说明 SSIO是基于早期工业现场300波特率通讯传输应用场景发展.演化而来. ...
- 项目中遇到的各种bug和踩过的坑
zepto 赋值时单位转换问题 zepto 的 animate 方法移动某个元素的位置时,例如修改某个绝对定位的元素的 left 值,要与修改前的值单位一致,修改前如果是像素值,修改后也要是像素值,否 ...
- bootstrap-datetimepicker.js 设置开始时间的Bug。
原地址:http://www.malot.fr/bootstrap-datetimepicker 修改的地方有三处: 1. var months = this.setTitle('.datetimep ...
- (高德地图)marker定位 bug 解决总结
项目背景: 一个项目bug,项目中用到高德地图,默认打开页面会生成一个marker(下图红色icon),然后用户拖动marker到想要的位置,并且保存. 用户反映定位不准确,在当前页面编辑的位置,到后 ...
- Ztree插件,定位节点时(focus)不能进入可视区域BUG解决方案
相关插件版本: jquery.ztree.exedit-3.4.js jquery.ztree.all-3.4.js jquery-1.8.0.js function onAsyncSuccess(e ...
随机推荐
- .Net 面试题 汇总(一)
1.@page指令只能在_aspx___文件(填写扩展名)中使用,而@Control指令只能用在_ascx___文件(填写扩展名)中使用. 2.说明控件DataGrid,DataTable,DataV ...
- OpenCV代码提取: threshold函数的实现
threshold algorithm: The simplest image segmentation method. All thresholding algorithms take a sour ...
- 高德API+.NET解决租房问题(JS相关)
在线地址:58同城品牌公寓高德搜房 Github地址:https://github.com/liguobao/58HouseSearch 知乎专栏(点赞用的):高德API+Python解决租房问题(. ...
- javascript 自定义发布与订阅
//声明一个类,与普通的类的声明不一样, function Girl() { //将类的事件声明成一个私有的属性,里面是一个对象 this._events = {} } /* { "失恋&q ...
- Android学习笔记之,调用系统图库,添加自定义字体,屏幕截图
新年开始的第一天就来学习了慕课迎春活动中的Android心愿分享一课,学到了几个知识点,在此记录一下. 1.调用系统图库调用系统图库用的是intent,步骤为弹出系统图库选择器,选择图片后获取到所选择 ...
- Windows自带的磁盘填充命令
一张不用了的SD卡要给别人,之前一直是手机使用的,担心有一些资料被恢复,想要将它内容清空.以前就知道数字公司有一个磁盘填充的工具,后来网上搜一搜发现Windows有一个自带的命令用于磁盘填充. 首先进 ...
- iframe底边多出4px或5px解决办法
问题: 在处理iframe框架自适应时,并且已经去掉iframe的边框,但仍然出现底边多出4px或5px高度的情况.如图 <div id="content"> < ...
- MongoDB复制二:复制集的管理
1.修改oplog的大小 需要在每个机器上都配置.先在secondary上操作,最后在primary上操作. 1)以单机的方式重启复制集的实例 db.shutdownServer() 在新的端口中启 ...
- ACM第一阶段学习内容
一.知识目录 字符串处理 ................................................................. 3 1.KMP 算法 .......... ...
- 【iOS开发】iOS开发CGRectGetMidX. CGRectGetMidY.CGRectGetMinY. CGRectGetMaxY. CGRectGetMinX. CGRectGetMaxX的使用
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 110, 150)]; label.backgroundColor ...