- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我刚开始编写代码,但一直困在我正在编写的代码中。首先,我将鼠标传递到名为“Article”的 DIV 容器中,里面的所有内容都会改变其不透明度。我只想改变里面的图像的不透明度,所以在 DIV 内部的任何地方,图像的不透明度都应该是 1。一旦鼠标移开,图像的不透明度应该变成 0.75。我尝试了多种代码,但 DIV 内的每个元素的不透明度都发生了变化。希望你能帮助我。
我试图更改文档。 getElementsByTagName ('article') [i] by document.getElementsByTagName('img')[i] 但是当鼠标悬停在图像上时它只是改变了图像的不透明度。我试过 document.getElementsByTagName('article')[i].getElementsByTagName('img')[i] 和以前一样。我试图通过 img.style 更改 this.style 没有任何反应......
for (var i = 0; i<document.querySelectorAll('article').length;i++)
document.getElementsByTagName('article')[i].onmouseover=function(){
this.style.opacity = 1;
}
for (var i = 0; i<document.querySelectorAll('article').length;i++)
document.getElementsByTagName('article')[i].onmouseleave=function(){
this.style.opacity = 0.75;
}
希望当我跳过一篇文章时图像不透明度会改变。谢谢,祝你们今年过得愉快!
最佳答案
尝试使用 querySelectorAll('article img') 而不是 getElementsByTagName。这只会影响 img inside article。
关于javascript - 如何通过将光标移到 DIV 上来在 DIV 中修改和成像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54172477/
我正在使用 PIL 在 Python 中进行一些图像处理,我需要从一系列图像中提取亮度层,并使用 numpy 对其进行一些处理,然后将编辑后的亮度层放回图像中并保存.问题是,我似乎无法以 YCbCr
问题是从内存中加载 jpeg 编码的图像。 我从套接字收到一个字符串: jpgdata = self.rfile.read(sz) 我知道这是 jpeg 编码的图像。 我需要解码它。最愚蠢的解决方案是
我目前正在检查一个项目的 django。我也在看 django-cms。 Django-cms 需要 python-imaging。我找不到在当前版本的 OSX 上安装它的简单方法,事实上,在我什至开
我在 Visual Studio Code 中开发 F#,当我尝试使用 FAKE 编译我的代码时,出现上述错误: warning MSB3245: Could not resolve this ref
我正在使用 Apache Commons Imaging library (Java 8,你可以找到我的代码 here )并且我遇到了一些标签问题: 如果我打开例如的图像信息this Win 10 的
尝试使用 PIL创建一个透明的 gif。到目前为止,我有这个: from PIL import Image img = Image.new('RGBA', (100, 100), (2
我在使用 leadtools imaging api 时在 asp.net 中遇到一个奇怪的错误。这是堆栈跟踪。 System.AccessViolationException: Attempted
我试图将最初的列表“ThetaVect1”转换为形状为(16,)的np.ndarray,将其更改为(4,4)数组,然后使用np.ndarray。 newaxis 来获得第三个维度,我试图将其设置为 3
对于 3d 成像软件,我正在编码: 我需要定义一个椭球 E,它可以在空间中具有任何半径、中心和旋转 用户界面允许用户控制 3 个椭圆,它们是椭圆的“切片”(图像中的红色、绿色、蓝色),并且(根据定义)
我是一名优秀的程序员,十分优秀!