Animating “src” attribute

后端 未结 7 576
轮回少年
轮回少年 2020-12-11 21:39

I have an HTML document. It looks like this:

\"original\"

When the user hovers \"stackinfo\" image, I w

相关标签:
7条回答
  • 2020-12-11 22:28

    Thank you for all your replies, but I found a method that works great!

    This is the CSS code:

    #Logo.MainMenu{
        margin-left: 0px;
        margin-right: 6px;
        margin-top: 0px;
        margin-bottom: 0px;
        width: 100px;
        height: 30px;
        background: url(/Resources/Images/MainMenu/logo.png);
        -webkit-transition: all 200ms ease;
        -moz-transition: all 200ms ease;
        -ms-transition: all 200ms ease;
        -o-transition: all 200ms ease;
        transition: all 200ms ease;
    }
    
    #Logo.MainMenu:hover { 
        background-image: url(/Resources/Images/MainMenu/logoHover.png); 
    }
    

    and on the HTML page:

    <div id="Logo" class="MainMenu"> &nbsp; </div>
    
    0 讨论(0)
提交回复
热议问题