Developer forum

Forum » Swift » Anhor Links in Swift

Anhor Links in Swift

Daniel Hollmann
Reply

Hi Dynamicweb.

We have a problem when using anchor tags with swift.

Whenever we have a link that links to an anchor on the same page as the link, the page immediately scrolls right back up to the top!

The behavior can be tested here

https://centerwebsites-dev3.azurewebsites.net/spisesteder   

But when we link directly to the anchor on a page like this: https://centerwebsites-dev3.azurewebsites.net/spisesteder#myank the page is not scrolled to the top afterwards.


I have disabled all my custom JavaScript, and I still had this behavior. I think that there are some Swift javascript, that might interferer here, maybe a global listener on the hashchange event?

 

We use Swift 1.00 and DW version 9.10.14


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Daniel

It comes from this event:

 

Which is part of the default Swift script:

So remove that from the script.

Votes for this answer: 1
 
Daniel Hollmann
Reply

Alright. That did it :)

Thanks

 

You must be logged in to post in the forum