1
我在jQuery中有這個代碼,我想用原型庫重新實現。如何在Prototype中重新實現外部彈出式jQuery代碼?
// make external links open in popups
// this will apply a window.open() behaviour to all anchor links
// the not() functions filter iteratively filter out http://www.foo.com
// and http://foo.com so they don't trigger off the pop-ups
jQuery("a[href='http://']").
not("a[href^='http://www.foo.com']").
not("a[href^='http://foo.com']").
addClass('external');
jQuery("a.external").
not('a[rel="lightbox"]').click(function() {
window.open(jQuery(this).attr('href'));
return false;
});
如何迭代過濾使用與jQuery中列出的not()運算符等價的元素集合?