Does calling `click ()` in jQuery only trigger jQuery related events?

I have a Magento site that includes a prototype JavaScript library.

Some time ago I added jQuery.

Before that, however, I included the Lightbox prototype. This was caused by the addition of an attribute rel="lightbox[gallery]".

Now I want to do a lightbox when the page loads. I don't know anything about the prototype, so I tried to create a hidden link with jQuery, and then called $('#special').click(), but to no avail. If I actually click on the link, it works fine.

All my jQuery code has this function

jQuery.noConflict();
jQuery(function($) {
 // Now I can use $ in here... :)

});

So click()does jQuery fire only jQuery related events? If so, how can I raise a click event or fire a lightbox in a prototype?

+3
5

, jQuery click() , jQuery?

, onEventName . , addEventListener() attachEvent() ( AFAIK Prototype ...)

click. ...

: ?

. :

+1
0

jquery jQuery noconflict, $ protoype jQuery, jQuery. , , . jQuery , ?

0

$, , :

jQuery(function() {
  (function($) {
    //
    // your initialization code goes in here
    // and you can use '$' safely as the name
    // of the jQuery object, even though
    // window.$ is something else
    //
  })(jQuery);
});
0

- $j = jQuery.noConflict jquery. $j

0

Source: https://habr.com/ru/post/1732793/


All Articles