【问题标题】:One of my images is not affected by opacity in CSS我的一张图片不受 CSS 中不透明度的影响
【发布时间】:2014-02-20 16:23:51
【问题描述】:

我有两个箭头中的一个,而且我没有用手指(它的 id="darrow")看不出受到我的不透明度的影响:0.7;我的 CSS 中的属性。任何人都可以看到有什么问题吗?在我添加第二个箭头和动画之前它工作得很好。然而,另一个箭头似乎完美无缺。

HTML:

<img src="images/stills/uarrow.png" id="uarrow">
<img src="images/stills/darrow.png" id="darrow"> <!--Problem arrow-->
<div id="footer">
<p id="fpara">Site/logo design by Zachary Ledyard.</p>
</div>

CSS:

#darrow
{
    bottom: 20px;
}

#uarrow
{
    bottom: -40px;
}

#darrow, #uarrow
{
    position: fixed;
    left: 50%;
    margin-left: -9px;
    padding: 0;
    width: 18px;
    height: 14px;
    opacity: 0.7;
    z-index: 11;
}

#darrow, #uarrow:hover
{
    opacity: 1.0;
}
#footer
{
    padding: 0;
    width: 100%;
    height: 70px;
    position: fixed;
    bottom: 0;
    border-top: 1px solid #000000;
    z-index: 6;
    background-color: rgba(255, 128, 0, 0.7)
}

jQuery;

$(document).ready(function(){
  $("#darrow").click(function(){
    $("#footer").animate({"top": "+=100px"}, "slow");
    $("#uarrow").animate({"top": "-=50px"}, "slow");
    $("#darrow").animate({"top": "+=100px"}, "slow");
  });
});

$(document).ready(function(){
  $("#uarrow").click(function(){
    $("#footer").animate({"top": "-=100px"}, "slow");
    $("#uarrow").animate({"top": "+=50px"}, "slow");
    $("#darrow").animate({"top": "-=100px"}, "slow");
  });
});

【问题讨论】:

    标签: jquery html css image opacity


    【解决方案1】:

    我相信你的意思是#darrow:hover。您正在覆盖原来的不透明度。

    你需要:

    #darrow:hover, #uarrow:hover
    {
        opacity: 1.0;
    } 
    

    你有:

    #darrow, #uarrow:hover
    {
        /* this is replacing the previous opacity of 0.7 for #darrow */
        opacity: 1.0;
    }
    

    【讨论】:

    • 啊,该死的。感谢您的快速回复。解决了,谢谢。
    猜你喜欢
    • 1970-01-01
    • 2013-07-03
    • 1970-01-01
    • 2020-08-10
    • 2020-07-14
    • 2014-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多