html - Changing DIV Background Image with JavaScript Not Working -


i'm trying change div background image on hover, want javescript works cross browser without issues. current code have is:

<div class="staff" style="background-image: url(/wp-content/uploads/2013/08/img_1828- 300x237.png);" onmouseover="this.style.background=url(wp-content/uploads/2013/08/img_1836-v2-300x237.png);" onmouseout="this.style.background=url(wp-content/uploads/2013/08/img_1828-300x237.png);"> </div> 

css:

.staff{ width: 300px; height: 237px; } 

can see causing problem?

<style>   .staff{       width: 300px;       height: 237px;       background-image: url(/wp-content/uploads/2013/08/img_1828- 300x237.png);   }    .staff:hover {       background-image: url(wp-content/uploads/2013/08/img_1836-v2-300x237.png);   } </style> <div class="staff"></div> 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -