我希望我的徽标可以在点击时更改css,因为它很好淡出..
我尝试过这样的事情:
$(".logo").fadeIn() .css({"opacity": "1.0","height": "75px"})
不起作用,以及:
$(".logo").css({"opacity": "1.0","height": "75px"})
$(".logo").fadeIn();
答案 0 :(得分:2)
您只能使用#include <iostream>
int main(){
int n[10] = {1,2,3,4,5,6,7,8,9,10};
int x[10] = {0,0,0,0,0,0,0,0,0,0};
std::cout << "Element" <<std::endl;
for(int i = 0; i < 10; i++)
{
std::cout <<n[i] << std::endl;
}
std::cout << "Value" <<std::endl;
for(int y = 0; y <10; y++)
{
std::cout << x[y] << std::endl;
}
std::cout << "size of array: " << sizeof(n) << std::endl;
}
属性和transition
:active
.logo{
background-color:yellow;
color:red;
padding:20px;
transition:opacity 2s linear;
opacity:0.3;
}
.logo:active{
opacity:1;
}
答案 1 :(得分:1)
您可以使用animate
方法和fadeIn
来完成此操作。
$('.logo').click(function(){
$('.logo').fadeIn().animate({'opacity':'1','height':'75px'}, 1500);
});
&#13;
.logo{
opacity: 0.1;
background: blue;
}
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span class="logo">Logo</span>
&#13;
查看此fiddle。