0

我正在尝试使用http://demo.tutorialzine.com/2011/06/beautiful-portfolio-html5-jquery/有一个教程页面@ http://tutorialzine.com/2011/06/beautiful-portfolio- html5-jquery/

我想添加鼠标悬停事件或单击事件,但我的代码不起作用。

$("ul#stage li").click(function() {
    alert("Over")

});

我在文档就绪功能中添加了事件,但没有工作。请帮忙。我为“悬停”事件尝试了类似的代码。

4

1 回答 1

1
$("ul#stage li").live('click', function() {
    alert("Over")

});

or for both events

$("ul#stage li").live({
  click: function() {
    // do something on click
  },
  mouseover: function() {
    // do something on mouseover
  }
});
于 2011-08-11T13:41:50.503 回答