Answer the question
In order to leave comments, you need to log in
jQuery: how to catch transition event inside document by anchors?
The page is linked using anchors (A tags with the name parameter). Top of the table of contents: a list of links to the underlying subsections. Now I somehow catch such transitions using the scroll () event, but this is incorrect and buggy. How to do it right?
Answer the question
In order to leave comments, you need to log in
brr… and what prevents your event from being clicked and hung?
$('a[name]').click(function(){
//your code
});
And if the content is at the top, then limit this event to clicking on links inside this block
$('#contents a').click()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question