0

This page: http://crossroadsphotographicworkshops.com/blog/blog-post-the-first/

I created the gallery, at the bottom. When a thumbnail is clicked, the lightbox opens, as expected, but the page behind it scrolls to the top. There is no # on my url. This doesnt happen on another site/theme. I assume this is caused by js in the parent theme. I've searched for scrolltop in the parent js, but no luck. I've looked in the dom of firebug, but dont really know what i'm looking for.

So, my question is, how do you inspect the events or targeted elements? How can you see all js attached to a given element? How can I figure out what is causing the scroll to top?

Doug Cassidy
  • 1,500
  • 2
  • 15
  • 25

1 Answers1

0
  • Assuming you are using Chrome, F12 for developer tools
  • Click on Sources tab
  • Expand Event Listener tab on the right and check everything that you think applies (or just everything)

try to nav through interactable elements and observe what happens in DOM Breakpoints on the righthand side of Sources tab as you go along.

If it doesn't work, inspect element the page to get the HTML and then right click the parent-most element (<html> or <body> tag) and at the bottom, set Break on to Subtree Modifications or whatever you think will work best, then re-interact with the site and observe what is called as it breaks.

HC_
  • 970
  • 8
  • 21
  • The problem axly turned out to be the overflow-y, mentioned in the comment to my question, but this procedure is going to be helpful in the future, and is a good answer, thank you. – Doug Cassidy Jun 09 '15 at 20:00
  • Out of curiosity could you elaborate? Was it a CSS glitch? – HC_ Jun 09 '15 at 20:51
  • http://stackoverflow.com/questions/13547007/fancybox2-fancybox-causes-page-to-to-jump-to-the-top/15306863#15306863 – Doug Cassidy Jun 10 '15 at 01:28