使用jQuery快速高效制作网页交互特效 第六章 上机练习五 制作全网热播视频页面

本文详细介绍了使用jQuery进行元素样式控制及事件处理的方法,包括选择器、样式修改、背景图片设置、鼠标悬停效果等核心功能。通过具体示例展示了如何为不同类型的列表项应用特定样式,并实现列表项鼠标悬停时显示隐藏信息的效果。
<script type="text/javascript">
  $(function () {
    $("ul>li:not(:last)").css("margin-right","10px");
    $("ul>li:not(:last) span,ul>li:last li:first span").css("background-color","#F0A30F");
    $("ol li:gt(0) span").css("background-color","#A4A3A3");
    $("ul>li:last").css("background-color","#F0F0F0");
    $("ol li:eq(0),ol li:eq(2),ol li:eq(3),ol li:eq(4)").css("background","url(images/orange.jpg) right -2px no-repeat");
    $("ol li:eq(1),ol li:eq(5),ol li:eq(6),ol li:eq(7)").css("background","url(images/green.jpg) right -2px no-repeat");

    var index = 0;
    $("ol li").mouseover(function () {
      index = $(this).index();
      $("ol li p").eq(index).show();
    });
    $("ol li").mouseout(function () {
      index = $(this).index();
      $("ol li p").eq(index).hide();
    });
  });
</script>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值