For this lab, I had to create a dim and bright effect that switches when I hovered over the division tags and it also replaced the text when you hover over it and when you hover out of it, it goes back to the original text. First I created the division tags with text on it and gave them id names. Then using jQuery, I made a variable containing the new text the original text would be replaced with. Using the id names I gave the division tags, I put a function for when the mouse enters and when the mouse leaves. When the mouse enters, I put a fading to effect on the division and using that division id name, I changed the html to put a different text speaking of the jQuery magic. Then when the mouse leaves, I put the original text back and put another fading to effect but with different speeds and opacity. I did the same thing with the other division tag. After that I uploaded it onto the server after I checked that it was working well. In the beginning there was like a glitch with my jQuery, because it kept on blinking from dim to bright instead of doing it with the hovering effect. Then I fixed it and put in something extra with replacing the text back to the original after I took the mouse out of the division tag.
No comments:
Post a Comment