atar.yosef Posted December 4, 2012 Share Posted December 4, 2012 Hi there!!I've noticed that when I'm trying to combine two CSS transitions effects, only the first one is executed and the second one is left behind. Can someone here explain me why does this occur and how to work around it?Here's a code snippet that combine two CSS transitions for your investigation: <html><head><title></title><script type="text/javascript">try{function start(){myDiv = document.getElementById("myDiv");myDiv.onclick = function(){myDiv.style.width = "160px"; myDiv.style.height = "160px";}}//end start().}//end try statement.catch(err){alert("there's an error in this page. \n the error message is:\n" + err.message + "\n the error name is: \n" + err.name + "\n and the error details are:\n" + err.constructor + "\n and the error stack is: \n" + err.stack);}//end catch statement.</script><style type="text/CSS">div#myDiv {background-color:blue; color:yellow; -webkit-transition:height 1s; -webkit-transition:width 1s;}</style></head><body onload="start()"><div id="myDiv">hhhhh</div></body></html> Thanks in advance!!Atar. Link to comment Share on other sites More sharing options...
justsomeguy Posted December 4, 2012 Share Posted December 4, 2012 It's the same as any other CSS rule. If you put 5 background colors in there it's only going to use one of them, not all of them. Look at the tutorial for examples of specifying more than one transition. http://www.w3schools.com/css3/css3_transitions.asp 1 Link to comment Share on other sites More sharing options...
atar.yosef Posted December 4, 2012 Author Share Posted December 4, 2012 @justsomeguy:Thanks you very much about your kind response!! I'm appreciate that!!Sincerely!!Atar. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now