Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're just using jQuery in this anonymous function you can wrap everything in the anonymous function:</p> <pre><code>(function ($) { $( "#accordion" ).accordion({ event: "click hoverintent" }); var cfg = ($.hoverintent = { sensitivity: 7, interval: 100 }); $.event.special.hoverintent = { setup: function() { $( this ).bind( "mouseover", jQuery.event.special.hoverintent.handler ); }, teardown: function() { $( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler ); }, handler: function( event ) { var that = this, args = arguments, target = $( event.target ), cX, cY, pX, pY; function track( event ) { cX = event.pageX; cY = event.pageY; }; pX = event.pageX; pY = event.pageY; function clear() { target .unbind( "mousemove", track ) .unbind( "mouseout", arguments.callee ); clearTimeout( timeout ); } function handler() { if ( ( Math.abs( pX - cX ) + Math.abs( pY - cY ) ) &lt; cfg.sensitivity ) { clear(); event.type = "hoverintent"; // prevent accessing the original event since the new event // is fired asynchronously and the old event is no longer // usable (#6028) event.originalEvent = {}; jQuery.event.handle.apply( that, args ); } else { pX = cX; pY = cY; timeout = setTimeout( handler, cfg.interval ); } } var timeout = setTimeout( handler, cfg.interval ); target.mousemove( track ).mouseout( clear ); return true; } }; }(jQuery)); </code></pre> <p>Basically you're wrapping the entire anonymous function around your javascript, passing jQuery into the anonymous function as $ and it will "override" prototype just within THIS anonymous function.</p> <p>Is that helpful?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload