Wiki

Clone wiki

clikkit / Home

clikkit

jsdoc
clikkit is a jQuery plug-in that enables links to load in a frame within the current page. It registers a 'click' event handler for the links that prevents the default action and adds the link to clikkit's link queue to be displayed in the clikkit frame. View Demo

Basic Usage

To enable links to be displayed with clikkit:

$( 'a' ).clikkit();


Configuration options can be passed to clikkit in a config object:

$( 'a' ).clikkit({
	expandedWidth: '900px',
	closeBarColor: 'green'
});


Advanced Usage

If the links on your page go to sites that are out of your control, you may encounter frame-busting sites - stompit can help you deal with them.

Events

The full list of events is documented in the jsdoc. There are 3 main events that are of most interest:

  • clikkitAddLink - this event fires when a link is clicked and about to be enqueued in clikkit. The event handler can process the link and, if desired, return a different link that should be enqueued instead (this is used in the clikkit Chrome extension to parse Youtube links and replace them with Youtube embed URLs). If your handler returns false or calls preventDefault() on the event, the link will not be enqueued.
  • clikkitCloseLink - this event fires when a link is closed.
  • clikkitShowLink - this event fires when a link is about to be displayed. This is used in the clikkit Chrome extension to highlight the currently active link on the source page.

Updated