JQuery Events

The quotation marks in the code, should not be curly””, it’s how wordpress formats them.

Here is a complete list of the events.  They allow users to interact with your website.

 

In your .js file, you add the standard jquery ‘ready’ code:
$(document).ready(function() {

Then select the header in your html, and give it a mousedown function:
$(“h1“).mousedown(function() {

That changes the background colour to red:
$(this).css(“background-color”,”red”);
});

Now, when you click on the <h1> on your webpage, the background colour should change to red.

Here is an example of a cool animation function
Here is another

Resources:
http://www.littlewebhut.com/javascript/jquery_events/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s