css - Transform scale property not working in Chrome & Safari -


.tricky {    width:200px;   height:200px;  border-radius: 50%;  border: 0px solid;  background: #2373bd;  display:inline-block;  position:relative;   overflow: hidden;    }    .tricky_image {  width:100%;   height:100%;  -moz-transition: .6s ease;   -webkit-transition: .6s ease;    -ms-transition: .6s ease;    -o-transition: .6s ease;    transition: .6s ease;   opacity:0.7;  border-radius: 50%;  filter:alpha(opacity=70);  overflow:hidden;    }    .tricky_image:hover {  opacity:1;  filter:alpha(opacity=100);  -webkit-transform:scale(1.2);  transform:scale(1.2);     }
<!doctype html>  <html>  <head>  </head>  <body>    <div class="tricky">    <img class="tricky_image" src="location_images/sanfranciscoweb.png" alt="example">    </div>        </body>  </html>

my desired effect working in firefox , assume ie. starting transparent image div wrapper around blue background. when user hovers on image, want zoom in , restore opacity 100% without breaking set width , height of div wrapper. works in firefox, when run animation in chrome image exceeds width of blue div wrapper behind it. here code , appreciated & js fiddle http://jsfiddle.net/yalupdzo/1/:

<!doctype html> <html> <head> <style>  .tricky {  width:200px;  height:200px; border-radius: 50%; border: 0px solid; background: #2373bd; display:inline-block; position:relative;  overflow: hidden;  }  .tricky_image { width:100%;  height:100%; -moz-transition: .6s ease;  -webkit-transition: .6s ease;   -ms-transition: .6s ease;   -o-transition: .6s ease;   transition: .6s ease;  opacity:0.7; border-radius: 50%; filter:alpha(opacity=70); overflow:hidden;  }  .tricky_image:hover { opacity:1; filter:alpha(opacity=100); -webkit-transform:scale(1.2); transform:scale(1.2);   }      </style> </head> <body>   <div class="tricky">   <img class="tricky_image" src="location_images/sanfranciscoweb.png" alt="example">   </div>     </body> </html> 

this known issue filed here: https://code.google.com/p/chromium/issues/detail?id=157218

in webkit, hardware acceleration, animated layers promoted different rendering surface during animation, , demoted once animation complete.

turns out there simple solution. have container element 'promoted' same rendering layer hardware accelerated child adding lightweight animation it:

.tricky {     width: 200px;      height: 200px;     border-radius: 50%;     border: none;     background: #2373bd;     display: block;     overflow: hidden;     -webkit-transform:scale(1.0); }  .tricky_image {     width: 200px;      height: 200px;     -webkit-transition: .6s ease;     opacity: 0.7; }  .tricky:hover {     -webkit-transform:scale(1.0); }  .tricky:hover .tricky_image {     opacity: 1;     -webkit-transform:scale(1.2);  } 

see: http://jsfiddle.net/yalupdzo/3/

note i've added simple animation parent container's default state, same issue doesn't happen when hovering out.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -