When I add the transition line into my code it breaks jQuery. How can I fix it?
a(this).next().css({
left: c,
transition: 'opacity 1s ease-in-out'
});
I’m trying to set up a fade from one div to the next inside a slider
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Step 1) Remove the semi-colon, it’s an object you’re creating…
to
Step 2) Vendor-prefixes… no browsers use
transitionsince it’s the standard and this is an experimental feature even in the latest browsers:Here is a demo: http://jsfiddle.net/83FsJ/
Step 3) Better vendor-prefixes… Instead of adding tons of unnecessary CSS to elements (that will just be ignored by the browser) you can use jQuery to decide what vendor-prefix to use:
Here is a demo: http://jsfiddle.net/83FsJ/1/
Also note that if you specify in your
transitiondeclaration that the property to animate isopacity, setting aleftproperty won’t be animated.