yarek
yarek

Reputation: 12064

How to intercept thickbox click?

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>

Upvotes: 0

Views: 40

Answers (1)

uingtea
uingtea

Reputation: 6554

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.

Upvotes: 0

Related Questions