class "container" contains the CSS code right?if u assign ID to all of your
parent div it'll be very helpful for u in this case & also in many
other scenarios or you can create CSS design on the basis of IDs.

On Wed, Apr 22, 2009 at 4:25 PM, gostbuster <jeremyescol...@gmail.com>wrote:

>
> Hi, thank you for you answser.
>
> Of course I could do that, expect that I'll have an undefined number
> of "container" div. That's why I gave them classes and no id !
>
> Thank you
>
>
> On 22 avr, 13:17, Zeeshan Khan <khan.zeesha...@gmail.com> wrote:
> > Instead of call the parent you can call Only that DIV of which u want to
> > change the background color
> >
> > $(document).ready(function(){
> >              //action when the mouse is over :
> >
> >                $("#delete").mouseover(function(){ // I select the .delete
> > divs.
> >                        //now i want to change the bg color of the
> > entire div, but only this div. here is my problem
> >                        $('#container').css('background-color','red');
> >                  //with this selection, I select ALL the parents,but
> > I want only the father..
> >                })
> >
> > //action when the mouse is out
> >                        $(".thumbdelete").mouseout(function(){
> >                                $('#container
> > ').css('background-color','white');
> >                        })
> >
> > })
> >
> > I think it might work.
> >
> > Regards;
> >
> > Zeeshan Ahmed Khan
> >
> > On Wed, Apr 22, 2009 at 4:11 PM, gostbuster <jeremyescol...@gmail.com
> >wrote:
> >
> >
> >
> > > Hi everyone,
> >
> > > I'm getting in trouble with this problem,
> >
> > > I have several divs which contains an image, and another div. we can
> > > imagine somethin like that :
> >
> > > <div class="container">
> > >         <div class="img">...my image...</div>
> > >         <div class="delete">delete</div>
> >
> > > </div>
> >
> > > What I want to do is, when I put the mouse over the div Delete (and
> > > only this one), I want to change the background of the
> > > entire .container div.
> >
> > > here is my code :
> >
> > > $(document).ready(function(){
> > >              //action when the mouse is over :
> >
> > >                $(".delete").mouseover(function(){ // I select the
> .delete
> > > divs.
> > >                        //now i want to change the bg color of the
> > > entire div, but only this div. here is my problem
> > >                        $(this+':parent').css('background-color','red');
> > >                  //with this selection, I select ALL the parents,but
> > > I want only the father..
> > >                })
> >
> > > //action when the mouse is out
> > >                        $(".thumbdelete").mouseout(function(){
> >
> > >  $(this+':parent').css('background-color','white');
> > >                        })
> >
> > > })
> >
> > > Your help would be very greatful.
> >
> > > Thank you very much in advance.
>

Reply via email to