如何在流星助手中实现这个jquery?

时间:2015-08-31 21:17:22

标签: javascript jquery html templates meteor

由于meteor jquery语法不同,如何实现?

$(document).mouseup(function (e)
{
    var container = $("YOUR CONTAINER SELECTOR");

    if (!container.is(e.target) // if the target of the click isn't the container...
        && container.has(e.target).length === 0) // ... nor a descendant of the container
    {
        container.hide();
    }
});

1 个答案:

答案 0 :(得分:1)

'mouseup body': function (e){
   var container = $("YOUR CONTAINER SELECTOR");

   if (!container.is(e.target) // if the target of the click isn't the container...
    && container.has(e.target).length === 0) // ... nor a descendant of the container
   {
       container.hide();
   }
}