4

I have a div with a certain id

<div id="services">

Then I try to link to it using Django templates

<a href="{% url 'homepage' %}#services">

But it only works if I'm in the same page (App) Is there a way to work around this ?

Zeyad Obaia
  • 686
  • 1
  • 6
  • 21
  • this should work. can you verify that the URL in the address bar is actually proper rendered, like www.yourpage.com/site#services ? – scott Dec 24 '16 at 06:07
  • 1
    Thank you, I found out what the problem was. I had a script that does smooth scrolling and it had " event.preventDefault();" in it. as I removed that it worked. – Zeyad Obaia Dec 24 '16 at 10:06

1 Answers1

3

I found out what the problem was. I had a script that does smooth scrolling and it had "event.preventDefault();" in it. as I removed that it worked.

Zeyad Obaia
  • 686
  • 1
  • 6
  • 21