Change background
Change background
Hi guys,
I'm ttrying to chance the background image of a DIV when an image is clicked in other div.
So i'm using this code:
- $(document).ready(function(){
- $(".portfolio #page #content #menuPortfolio ul li img").click(function(){
- var imgArea = $(".portfolio #page #content #imgGrande");
- imgArea.css("background", "url(../images/fotos/"+$(this).attr("id")+".jpg) center center no-repeat");
- });
- });
My CSS is:
- .portfolio #page #imgGrande{
- width:460px;
- padding:5px;
- margin-bottom:10px;
- border: 1px solid #adadad;
- background: url(../images/fotos/fogos.jpg) center center no-repeat #efefef;
- height:306px;
- }
But the div gets without any image, even the default image i set in css. So i checked the code with firebug and the css is being changed right. But even in the firebug, the thumb image do not load. :(
Could someone try to explain me what am ir doing wrong?