本文所分享的知识点是【JS.elementGetStyle(element, style)应用示例】,欢迎您喜欢我爱IT技术网所分享的教程、知识、经验或攻略,下面是详细的讲解。
JS.elementGetStyle(element, style)应用示例
function UiWebhighlight(element,color) {
if (!element) {return}
var highLightColor="yellow";
if (color) {highLightColor=color}
if (element.originalColor==undefined) { // avoid picking up highlight
element.originalColor=elementGetStyle(element, "background-color");
}
elementSetStyle(element, {"backgroundColor" : highLightColor});
window.setTimeout(function () {
try {
//if element is orphan, probably page of it has already gone, so ignore
if (!element.parentNode) {
return;
}
elementSetStyle(element, { "backgroundColor": element.originalColor });
} catch (e) { } // DGF unhighlighting is very dangerous and low priority
}, 200);
}
关于JS.elementGetStyle(element, style)应用示例的相关讨论如下:
相关问题:请详解js的document.defaultView.getComputedStyle...
答:document.defaultView返回当前文档关联的window对象 Window.getComputedStyle()返回元素的计算后的css样式 >>详细
相关问题:JS如何用document.getElementById(divid).style.di...
答:document.getElementById(divid).style.display只是控制元素的显示隐藏状态,调整顺寻,需要用到其他的写法,请把你的代码补全,要不没法给出回答 >>详细
相关问题:JS 关于document.getElementById("id").style.heig...
答:确定winHeight能够获取到值了吗?你这样写法不能兼容所有浏览器。 var winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
