Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link to a specific div in another app(page) in Django using anchor tag

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 ?

like image 371
Zeyad Obaia Avatar asked Oct 17 '25 07:10

Zeyad Obaia


1 Answers

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.

like image 140
Zeyad Obaia Avatar answered Oct 18 '25 21:10

Zeyad Obaia