0 Replies - 727 Views - Last Post: 07 May 2012 - 06:37 AM

#1 dameon51   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 73
  • Joined: 07-June 10

bind/on function chrome problem

Posted 07 May 2012 - 06:37 AM

In Chrome, when I use on/bind, it seems to be querying the first click, and then it runs the first and second click at the same time... UNLESS I have an alert in the call back. This is my code...

Doesn't work, unless I click twice, but then runs twice
	$(".pGHeader").on(
		"click",
		function(){
			$(this).next().toggle();
		}
	);


Works
$(".pGHeader").on(
		"click",
		function(){alert("the hamster dance will never get old");
			$(this).next().toggle();
		}
	);

Myabe some sort of race condition? But it works fine in FF and IE (yes even IE!) and this is the only spot I have JS running on that event... Oh maybe somethings bubbling too, I'll look into that.

Thanks

This post has been edited by Dormilich: 07 May 2012 - 07:17 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1