Question

I am trying to animate() with zoom in and out from the center of the div, not the top left corner. Currently it is set to margin:auto and top:0; right:0; bottom:0; left:0; and works great with Chrome/firefox/Safari except or IE 9.

$(document).ready(function () {
    $('.viewportOut').mouseenter(function(e){
    $(".L3").animate({
    opacity:"1", 
    zoom: '1%'
    }, function(){ $(".L3").animate({
    opacity:"1", 
    zoom: '100%'
    });});             
});   
});

<div>
<div class="viewportOut">
<div class="L3">
<ul id="claims-list2" class="list-group">
<li><a href="#" class="list-group-item claim-item">Claim 1</a></li>
<li><a href="#" class="list-group-item claim-item">Claim 2</a></li>
<li><a href="#" class="list-group-item claim-item">Claim 3</a></li>
<li><a href="#" class="list-group-item claim-item">Claim 4</a></li>
<li><a href="#" class="list-group-item claim-item">Claim 5.</a></li>
</ul>
</div>
</div>
</div>

.viewportOut div {
position:fixed; top:0; right:0; bottom:0; left:0;
    margin:auto;
    width:300px;
    height: 200px;
    max-width:100%;
    max-height:100%;
}
 .L3 {
    overflow: hidden;
    background: red;
    border: 2px red solid;

}

Here is the jsfiddle that I am working on: http://jsfiddle.net/YHRvY/4/

doctype is and the meta is set to .

Any helps will be much appreciated.

Thanks!

Was it helpful?

Solution

You may be looking for similar question

$(document).ready(function(){
    $('.viewportOut').hover(function() {
        $(".viewportOut").addClass('transition');
    }, function() {
        $(".viewportOut").removeClass('transition');
    });
});

DEMO

as transition animation properties are not supported in IE9 zoom effect would not be as smooth as other modern browsers

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top