How to cause a hang state of a channel when it hangs over its parent LI. JQuery

I am trying to cause a hang state in a text link when it hangs over whether the parent is. Is this possible in CSS, and secondly, I missed something with .children that would solve this problem. Here's the HTML:

<li class="video-1">                                    
  <a href="#"><img src="images/csi-1.gif" alt="csi-1" width="140" height="80" /></a>
  <h3 class="show-title"><a href="#">Show TItle</a></h3>
  <h3 class="ep-name"><a href="#">Episode Name</a></h3>
  <h4 class="season-info">Season 4 | Ep 10<span class="more"><a href="#">See More</a></span></h4>

</li>

And JS:

$(".more").hide();

$(".video-1").hover(function () {
$(".video-1:hover h3.show-title a").css('color', '#006699'),function() {
    $(this).css("color", "#fff");
             }      
   $(".more").toggle();   

});
+5
source share
2 answers

You can only create freezing effects with CSS, like this (in your stylesheet):

.video-1 .more { display: none }
.video-1:hover h3.show-title a { color: #006699 }
.video-1:hover .more { display: block }

There is no need for JS at all unless you need IE6 support that only supports elements :hoveron a.

UPDATE:

You can add something like this to your HTML if you also need to support IE6:

<!--[if lte IE 6]>
<script type="text/javascript" charset="utf-8">
  jQuery(function ($) {
    $('#video-1').hover(function () {
      $(this).addClass('hover');
    }, function () {
      $(this).removeClass('hover');
    });
  });
</script>
<![endif]-->

Then configure the CSS as follows:

#video-1 .more { display: none }
#video-1:hover h3.show-title a, #video-1.hover h3.show-title a { color: #006699 }
#video-1:hover .more, #video-1.hover .more { display: block }

, , HTML class id, IE6 CSS:

<li id="video-1">
+11
.video-1:hover{color:#fff}
.video-1 .more { display: none }
.video-1:hover .more { display: block; z-index:10 }

z-index ,

+1

All Articles