Mootools morph - div 覆盖图像的问题

发布于 2024-12-21 12:59:56 字数 343 浏览 2 评论 0原文

不知道是否有人可以对此有所了解

http://jsfiddle.net/orbitalmedia/ZrxBb/7/< /a>

基本上我正在尝试在图像上创建盲效果。 addClass 或toggleClass 能够应用样式,但我试图改变叠加层,以便它在图像上产生动画效果。

Ta

编辑..

这可行,但我试图使用 morph 和 css 类

$('span_2_0').tween('width', 150);完成同样的事情

Wonder if anyone could shed some light on this

http://jsfiddle.net/orbitalmedia/ZrxBb/7/

Basically I'm trying to create a blind effect over an image. addClass or toggleClass is able to apply the style but I'm trying to morph the overlay so it animates over the image.

Ta

Edit..

This works but I'm trying to accomplish the same thing using morph and a css class

$('span_2_0').tween('width', 150);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

做个少女永远怀春 2024-12-28 12:59:56

当你执行 .morph(".classname") 时,它只会采用它可以变形的属性并应用它们,即颜色、大小等,而不是 z-index 或位置。

无论如何,您需要 .在类名之前,然后预先设置基本 css 属性:

$('span_2_0').morph('.overlay');

不要使用颜色名称。使用可以变形的十六进制值。

#span_2_0 {
    display: block;
    position: absolute;
    z-index:1;  
    background-color: #fff;
}
.overlay {
    background-color: #0000ff;
    width:75px;
    height:150px;
}

http://jsfiddle.net/ZrxBb/12/

when you do .morph(".classname"), it will only take the properties it CAN morph and apply them, i.e. color, size etc. not z-index or position.

in any case, you need the . before the classname and then set the base css properties beforehand:

$('span_2_0').morph('.overlay');

do not use color names. use hex values that can be morphed.

#span_2_0 {
    display: block;
    position: absolute;
    z-index:1;  
    background-color: #fff;
}
.overlay {
    background-color: #0000ff;
    width:75px;
    height:150px;
}

http://jsfiddle.net/ZrxBb/12/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文