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
Post a Comment