0

Especially on smaller screens like iPad and iPhone it happens that a click on a element does not only trigger the "onclick function of the actual script but also the "onclick" function of the javascript of the underlaying div.

On my homepage http://www.somersetsights.co.za/en/index.html for example on a iPad a click on the like button activates the FB Like dialog and a click on the OK button of this Like dialog triggers the start of a movie from the slideshow function underneeth the Like dialog.

I tried to find a solution by googling this problem but struggled to find something. I am not a beginner but I am also not a experianced javascript programmer. Help would be very much appreciated.

Peter

Sampson
  • 265,109
  • 74
  • 539
  • 565
afrikapit
  • 29
  • 1
  • 9
  • This is what is known as event bubbling. One solution is to attach 1 event handler on the top level Dom event and within that function switch the action for that event based on the rules of your design - http://stackoverflow.com/questions/4616694/what-is-event-bubbling-and-capturing – Rob Sedgwick Jan 05 '14 at 13:21
  • Look at `e.target` where `e` is the _Event_. – Paul S. Jan 05 '14 at 13:23

1 Answers1

0

Maybe that could help you : http://www.quirksmode.org/js/events_order.html Tell us if you use jQuery or another JS library.

farvilain
  • 2,552
  • 2
  • 13
  • 24