I have an DIV container with an id="myDiv" attribute+value. I’d like to fade this in/out smoothly.
Would I have to create some sort of run loop with an timer and then modify the opacity value of the DIV?
Is jQuery perfect for this kind of stuff?
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.
The jQuery has
fadeInandfadeOutmethods to create the fading effect. You can for example use them like this on your div:Or you can also use the
animatemethod and specify theopacityoption to it to create the fading effect.Not to forget about the
fadeTomethod too 🙂