(tab) How to set site.ru/#sec1 unique URL: site.ru/about?

0 like 0 dislike
6 views
Good afternoon. Is there a way to make the tabs look CNC links?
  • For example: on my page there is a tab site.ru/#sec1 and when you click on it skalitsa page to the desired section.
  • Goal: to give people a link like: site.ru/bestoffer and to transition it was to the same section (site.ru/#sec1)
by | 6 views

1 Answer

0 like 0 dislike
If there is routing and you can control the output programmatically(that is, understand how works routing/controllers), there is no problem in a view to the conclusion of the JavaScript scroll to the correct anchor, the presence of keywords in the router/parameter.
something like this:
//in controller/action if(!empty($this->param[0])){ $this->view->scrollTo = $this->param[0]; } // in a view \r$(document).ready(function () {\r<?\rif(!empty($this->scrollTo)){?>\rlocation.hash = "#<?=$this->srollTo?>";\r<? } ?>\r})\r
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
6 answers
0 like 0 dislike
6 answers
asked Mar 21, 2019 by skobkin
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
33,863 users