javascript - Is there anyway to hover over a link, and make that change an image or background image? -


this question has answer here:

i think best way css or javascript. im not sure possible.

all css have

html {     background: url(http://i.imgur.com/6oqxuwz.jpg) no-repeat center center fixed;     background-size: cover; }   /* unvisited link */ a:link {  }  /* visited link */ a:visited {  }  /* mouse on link */ a:hover {  }  /* selected link */ a:active {  } 

<script>  jquery('#link').hover(function()  {  jquery('body').css("background-image", "url('foo/bar.png')"); });  </script> 

you try above, # being id can change . use class. can use change elements of div changing body again #foo or .foo depending on whether you're using class or id. hope helps.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -