tags:

views:

23

answers:

1

are there any good plugins to handle clicks based on the element clicked ?

for example, if link is clicked display a box with options. if form is clicked display a box with different options.

or any pattern suggestion would be useful.

A: 

For just handling clicks you could use click()

$('a').click(callback);
$('form').click(another_callback);

And for "boxes" (which I bet is just a "modals") you could also look at http://choosedaily.com/1178/15-jquery-popup-modal-dialog-plugins-tutorials/ or even google - because there are a really lot of implementations and we don't know what you expect from that "box".

You can start with http://nyromodal.nyrodev.com/ due to it looks nice and "featurefull".

zerkms
hi what did you mean by callback ? is that where the function goes ? how can I achieve asynchronous behavior meaning when I click on a link, browser will pause for user interaction on the popup, before navigating to the next location.
Kim Jong Woo
decompose your task into 2: 1) to handle click 2) to process it. `callback` there is a particluar existing function or anonymous one. "$('a').click(function() { // show popup here }); --- this is the trivia sample of anonymous one.
zerkms