javascript - Assigning click event to multiple elements with different parameters -


i want give click event many elements of same type, function depending on position.

i want click place div under clicked element.

this tried , it's not working.

$("#report-tabs .report-actions").each(function(){     this.click(function(){         var offset = $(this).offset();         this.next().offset({left: offset.left});     }); }); 

any suggestions?

try this

$("#report-tabs .report-actions").on('click', function(){         var offset = $(this).offset();         $(this).next().css('left', offset.left + 'px'); }); 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -