改变RGBA Alpha透明度与jQuery [英] changing rgba alpha transparency with jquery

查看:1021
本文介绍了改变RGBA Alpha透明度与jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  

可能重复:结果
  的jQuery + RGBA颜色动画


哎,

我想改变悬停的RGBA值的不透明性,但不透明度保持在0.07 ..也许OU可以帮我找到的错误。

CSS(IE黑客是单独的文件 - 无需一一列举)

  .boxcaption {
   浮动:左;
   位置:绝对的;
   高度:100像素;
   宽度:100%;
   背景:RGB(255,144,11);
   背景:RGBA(255,144,11,0.7);
}

JS

  VAR thumbslide = $('。boxgrid.captionfull')。点击(函数(){
    。$('。boxgrid.captionfull.clicked')removeClass移除(点击)儿童('盖')停止()动画({顶:230,背景:RGBA(255,144,11,0.7 )},350);
    $(本).toggleClass(点击),儿童(覆盖。)停止()动画({顶:。0,高度:230px背景:RGBA(255,144,11,1) },350);
});


解决方案

jQuery的颜色插件不支持RGBA。用这个来代替:<一href=\"http://roxority.com/sharepoint-zen/jquery-color-animations-adding-rgba-alpha-channel-support.html\"相对=nofollow>链接文本

Possible Duplicate:
jQuery + RGBA color animations

hey,

i want to change the opacity of an rgba value on hover, but the opacity stays at .07.. maybe ou can help me find the mistake.

CSS (IE hacks are in seperate file - no need to mention them here)

.boxcaption{
   float: left;
   position: absolute;
   height: 100px;
   width: 100%;
   background: rgb(255, 144, 11);
   background: rgba(255, 144, 11, 0.7);
}

JS

var thumbslide = $('.boxgrid.captionfull').click(function() {
    $('.boxgrid.captionfull.clicked').removeClass('clicked').children('.cover').stop().animate({top: 230, background: 'rgba(255, 144, 11, 0.7)'}, 350);
    $(this).toggleClass('clicked').children('.cover').stop().animate({top: 0, height:"230px", background: 'rgba(255, 144, 11, 1)'}, 350);
});

解决方案

the jquery color plugin doesn't support rgba. use this instead: link text

这篇关于改变RGBA Alpha透明度与jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆