图像映射jquery

时间:2012-04-23 16:50:44

标签: javascript jquery imagemap

我有一张带有各种图像地图的图像,例如:

<map id="rade_img_map_1335199662212" name="rade_img_map_1335199662212">
<area href="http://" coords="10,10,160,47" shape="RECT" /></map>

如何使用jquery向我的ul li添加内联样式

<ul id="level3">
<li>Test</li>
<li>rwer</li>
<li>wer</li>
<li>sdf</li>

因此,如果上面的图像映射是Test,我如何在悬停时触发jquery?如果我为每个图像映射设置了href,那么我可以使用jquery读取值吗?

编辑我已经尝试了这个,但我不能让课程在没有徘徊时删除:

  $(document).ready(function () {
      $("#rade_img_map_1335199662212").hover(function () {
          $("li#rs1").removeClass("active");  //Make sure no other "active" classes exist
          $(this).addClass("active");  //Add the active class to the area that was clicked
      });
  });

0 个答案:

没有答案