I have this code and this script:
$(document).ready(function() {
$('#unua').hover(function() {
$('#pagina').css('background-image', 'url(imagini/1.png)');
}, function() {
$('#pagina').css('background-image', '');
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="pagina">
<div id="primalinie">
<div id="unu" class="cerculet">
<div id="unua">
<a href="http://tineriiuniti.ro/contact/">Contact</a>
</div>
</div>
<div id="doi" class="cerculet">
<div id="doia">
<a href="http://tineriiuniti.ro/despre-atu/">About Us</a>
</div>
</div>
</div>
Can you tell what's the problem here? The ID "pagina", is for the whole page. Let me clear you out the problem. I will want whenever a user is with the mouse over one div the background image of the site will change. Different div, different image. :(