How to intercept thickbox click?

41 Views Asked by At

I got that script and it is never called (I tried more specific that a.thickbox with no success): How can I intercept the thickbox clicking ?

jQuery(document).on('click', 'a.thickbox',   (e)=> {
    debugger;
    console.log('clicked');
});

My html is:

<a href="#TB_inline?&inlineId=editInterviewContainer" class="thickbox custom1">Edit</a>
1

There are 1 best solutions below

0
uingtea On

if you search for jQuery(document).on('click', function) not working there are no clear solution.

you can try the following, for static element

$('a.thickbox').on('click', (e)=> {
    console.log('static clicked');
});

for dynamic element

jQuery(document).on('click', 'a.thickbox',   (e)=> {
    debugger;
    console.log('clicked');
});

and use both if you have static and dynamic thickbox element.