Jump to content
php.lv forumi

hover on div in order to change background to body


hoboonrails

Recommended Posts

Sveiki,

 

Vispirms laikam jau jāatvainojas visiem ekstrēmi patriotiski noskaņotajiem, ka raksta nosaukums ir angļu val.(latviski nespēju atrast īstos vārdus; tāds nu tas laikmets mums ir, ko darīs...). Bet nu pie lietas, ideja samērā vienkārša - ir vēlme fonu (body) padarīt nedaudz dzīvīgāku; tas tiek darīts, kad kursors ir pārklājis div (šis div ietver visu web lapas saturu). Ceru, ka domu sapratāt. Ir kādam kāds padoms dodams?

Link to comment
Share on other sites

http://jsfiddle.net/4AW2G/2/

 

js:

$('#d1').hover(function(){
   $('body')
       .stop(true,true)
       .animate({backgroundColor:'#f80'},500)
       .animate({backgroundColor:'#40f'},500)
       .animate({backgroundColor:'#0f0'},500);
},function(){
   $('body')
       .stop(true,true)
       .animate({backgroundColor:'#fff'},1000);
});

Edited by codez
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...