jquery - Make div container clickable, except export button -


i want create highcharts chart whole div has onclick function, don't want export button handle event on click. should react normal export button.

i have tried jquery tricks avoid it, getting highcharts buttons class: highcharts-button, doesn't work :

jquery("#container").on('click', ':not(.highcharts-button, .highcharts-button *)', function(e){         e.stoppropagation();         alert('click');     }); 

here jsfiddle. (problem is: don't want see alert pop when click export button).

one way filter event target, e.g:

jquery("#container").on('click', function(e){           if ($(e.target).closest('.highcharts-button, .highcharts-contextmenu').length) return;     e.stoppropagation();     alert('click'); }); 

-jsfiddle-


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -