Alessandro Minoccheri
Alessandro Minoccheri

Reputation: 35973

css3 element doesn't work on IE9

I know that in IE9 I can add more than one image in a div and is possible to use background-position and background-image in IE9. But my code doesn't work, I don't see the animation to scroll down when click on a div. Why? This is the code: (In firefox and Chrome works fine)

DEMO

HTML:

<script type="text/javascript">
$(document).ready(function(){
    var bg = $('.second').css('background-image');
    $('.second').css('background-image',bg+', url(http://www.dummyimage.com/643x12/001aff/ffffff.png)');
    $('.second').css('background-position', '0 0px, 0 -100px'); 


    $(".second").on("click", function() {
        $(".second").css('background-position', '0 200px, 0 100px'); 
    });

});

</script>
</head>
<body>
<div class="second">

</div>

CSS:

.second{
     position: absolute;
    border: solid;
    top:0;
    left:0;
    z-index: 2;
    height: 100%;
    width: 1000px;
    overflow: hidden;
    background:url(http://www.dummyimage.com/643x12/001aff/ffffff.png) no-repeat;

    transition-property: background-position; /*standard*/
    transition-duration: 1s;

    -webkit-transition-property: background-position; /*Safari e Chrome */
    -webkit-transition-duration: 1s;

    -o-transition-property: background-position;      /*Opera*/
    -o-transition-duration: 1s;

    -moz-transition-property: background-position;    /*Firefox*/
    -moz-transition-duration: 1s;   

}

Upvotes: 1

Views: 165

Answers (1)

Rob
Rob

Reputation: 15160

Transitions do not work in IE9. Only modern browsers and, finally, IE10.

Upvotes: 1

Related Questions