2013-04-11 53 views
0

以下是我的代码,当.clickover函数被调用时,所有我想要的,那么它也应该调用$(".popover").css函数。请让我知道,我怎么能做出这样的嵌套查询嵌套的jquery - 当一个函数触发时,它也应该触发另一个函数

$(function() { 
      $('#notc').clickover({ 
      title: "Notifications" 

      },   function() { 
      //$("div.popover").css("margin-left","60px"); 
      alert("hi"); 
      }); 

     }) 
+0

是你的警报被解雇? – 2013-04-11 14:00:32

+0

@thedixon no ..... – user2213071 2013-04-11 14:02:09

+0

@AleksG它是一个自定义函数,用于显示引导弹出窗口 – user2213071 2013-04-11 14:02:36

回答

2

从着眼于引导文档,第一个功能,我发现这可能是对你有用的是onShown,如:

$(function() { 
     $('#notc').clickover({ 
      title: "Notifications", 
      onShown: function() { 
       $("div.popover").css("margin-left","60px"); 
       alert("hi"); 
      } 
     }); 

}); 
+0

不应该'onShow'在参数里面,'title'旁边? – 2013-04-11 14:08:33

+0

这是真的,我的坏,纠正。 – 2013-04-11 14:09:08

+0

非常感谢你:) dixon :) – user2213071 2013-04-11 14:10:04