Hey! Sorry for the long gap. It’s been over a month since my last post, which is not ok. Luckily, I’ve recently started the 100 days of code challenge along with a number of the other CodeNewbies, and that should help keep me on track. Also, I’m working on some changes to the blog that should be coming up here in the next week or so. I actually got a url that means something, which is neat! More on that after the change.
Just Selecting Stuff
The very first useful thing you should know is how to get at (or create) things in the DOM. This is something that JQuery makes really easy, but here’s how to do it the rugged way.
Making Things Happen (Events)
I hinted at this in the previous section. What if you want to run some magic voodoo everytime someone mouses over your title or everytime someone submits a form? It’s really that simple.
And that’s it! Now, the first time the user mouses over the title, its font will grow to 48px. Note that you would have to listen for a
mouseleave event and pass in a different function if you wanted it to shrink back to normal once the user mouses out of the title.
A lot of times, it is the easiest to simply toggle a class and handle all of the excess animations, changes, styling in the css. Makes things easier to read and find.
Anyways, that’s it for now. More coming soon!