forum

Home / DeveloperSection / Forums / How to access this children div

How to access this children div

Anonymous User 1932 15-Jun-2013
Hi Expert,

I want to know how to use access this inside contents.

<div class="content">
    <div class="more">more</div>
</div>
<div class="content">
    <div class="more">more</div>
</div>
<div class="content">
    <div class="more">more</div>
</div>

CSS:

.content .more{
    background:#009474;
    display:block;
    width:70px;
    height:25px;
}
.content:hover{
    transition-property: background;
    transition-duration: 2s, 1s, 0.5s, 0.5s;
    background:#009474;
}

Jquery:

$(".content").hover(function(){
    $(".content .more").css("background-color", "#D0D0D0");
  },function(){
  $(".content .more").css("background-color","#009474");
});

My aim is on hover that content should change to #009474 color, and inside class "more" color to some other. With this code on hover all other class "more" are changing. So what can i do to have only inside class to change color on hover.
Is $(this '.more') right to use but I am getting no change with this.

Any help on above is really appreciated.

Updated on 15-Jun-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By