Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <style>
  2. .myhover {
  3. width: 120px;
  4. }
  5. .myhover:hover p{
  6. color: #FED242!important;
  7. }
  8. </style>
  9. <div id="divParent" class="myhover">
  10. <p>Some text</p>
  11. <p>Text text text</p>
  12. <div id="divChild" class="myhover">
  13. <p>Example text</p>
  14. </div>
  15. </div>
  16.  
  17. <script>
  18. $(document).ready(function(){
  19. $(".myhover p").hover(function(){
  20. $(this).parent().children("p:not(:last)").css("background-color","#FED242");
  21. });
  22. });
  23.  
  24. .myhover p:last-of-type {
  25. background-color:#FED242 !important;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement