Javascript更改事件目标不透明度

时间:2019-02-24 10:29:38

标签: javascript

我尝试使用此代码将不透明度更改为0.7:

//if div hasn't been mouseovered
if(!e.target.getAttribute('data-shade'))
    e.target.style.background = color;
    e.target.setAttribute('datashade', 1);
//else div has been mouse overed
else
    e.target.style.cssText = 'opacity: 0.7';

为什么变白了?

*对不起英语不好

0 个答案:

没有答案