简体   繁体   English

过渡在IE10中不起作用

[英]Transition is not working in IE10

I am using following code for animating svg path. 我正在使用以下代码为svg路径设置动画。 This works fine in chrome and firefox. 这在chrome和firefox中效果很好。 But in IE scaling one happens. 但是在IE缩放中却发生了一种情况。 Transition is not working. 过渡无效。 Please find my code 请找到我的代码

 function transform() { var scale = "scale(2 2)"; var path = document.getElementById("scale"); //path.setAttribute('transform', scale); //path.style.transition = "all 2s"; var style = document.createElement('style'); style.type = "text/css"; style.innerHTML = '.two{-webkit-transition: all 5s 0.5s;transition: all 5s 0.5s;} .grow{-webkit-transform: scale(2.0,2.0);}'; document.body.appendChild(style); path.setAttribute('class', 'two grow'); } 
 <button onclick="transform()">Scale</button> <svg width="900" height="600"> <g transform="translate(110,110)"> <path d="M0 -43.3 50 43.3 -50 43.3Z" fill=" yellow" stroke="blue" stroke-width="2" id="scale" /> </g> </svg> 

Any suggestions to achieve this kind of animation in IE10? 对在IE10中实现这种动画有什么建议吗?

If you do not have a proper doctype declaration as the very first line in a document, IE will enter compatibility mode and most features will not work as expected. 如果您没有适当的doctype声明作为文档的第一行,则IE将进入兼容模式,并且大多数功能将无法正常使用。 Ensure that you have a valid doctype (!DOCTYPE html will be fine) and add meta http-equiv="X-UA-Compatible" content="IE=edge" to your document . 确保您具有有效的doctype(!DOCTYPE html会很好),然后将meta http-equiv =“ X-UA-Compatible” content =“ IE = edge”添加到您的文档中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM