jQuery Ignoring Click Events In Webkit On Elements Selected Via Attribute -
i've run issue click events being ignored on elements selected attribute values in webkit browsers.
to clarify, i'm attempting trigger click on selected event, not bind function click event.
the html
<div class="my_list"> <a href="#thumb_1">thumb o1</a> <a href="#thumb_2">thumb o2</a> <a href="#thumb_3">thumb o3</a> </div>
the jquery
var my_var = 1; $('.my_list a[href="#thumb_' + my_var + '"]').click();
the event fires in firefox, not safari or chrome.
also tried
var my_var = 1; $('.my_list a[href="#thumb_' + my_var + '"]').trigger('click');
any appreciated, thanks.
edit
to whomever voted close 'not real question' ... please clarify otherwise i'll assume you're zealot who's life empty have keep going bs of voting close questions on so.
i assure real question. it's real problem i'm trying solve real client happy , can paid real money i've completed deliverables.
seems working fine in chrome: jsfiddle
var my_var = 1; $('.my_list a[href="#thumb_' + my_var + '"]').click(function(){ alert("you click thumb"+ my_var); });
since define my_var equals 1, first "thumb" attached click handler.
Comments
Post a Comment