jQuery Code

I found jQuery very easy to use and understand, I’d also realized what it could be used to make so I said to the team about adding some to the website and they were all in for making the website slightly personal and seem smoother.

jquery

” $(function() { ” I am telling the jQuery not to do anything until the page has loaded.

” $(‘ul #navbar’).mouseover(function(){ ” Here I am saying, when the mouse is over an unordered list with the id navbar something will happen.

” $(this).css({“color”: “grey”}); ” here, the object that the mouse is over will change its color to grey.

This is then reversed with;

” $(‘ul #navbar’).mouseleave(function(){
$(this).css({“color”: “white”}); ” which is saying, when the mouse leaves this object change its color to white

the next few lines follow the same rules with the mouse entering but instead change the background colour of the div to a light grey and the height and width of the picture to 5 pixels larger.

$(‘.content’).mouseenter(function(){
$(this).css({“background”: “#bfbfbf”});
});
$(‘.content img’).mouseenter(function(){
$(this).css({“height”:”155px”, “width”:”155px”});
});

Advertisements

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

%d bloggers like this: