1
I need you to ask me a question, I created a page and put the menu in PHP. Follow data:
php menu.
<div class="col-md-9 text-left float-left collapse-navation">
<div class="navbar-collapse collapse navbar-inverse no-transition">
<ul class="nav navbar-nav navbar-left">
<li><a href="../index.html">Home</a></li>
<li><a href="../#sobre">Sobre</a></li>
<li><a href="../#work">Destaques</a></li>
<li><a href="../#titulos">Títulos</a></li>
<li><a href="../#testimonial">Testemunho</a></li>
<li class="last"><a href="../#contato">Contato</a></li>
</ul>
</div>
</div>
And I put in another page include.php:
<?php
include ('../menu.php');
?>
But when the menu enters the page the links created do not work when you click on them, only working if you right-click and open in new tab. What could it be? The problem is just this, the links.
My server is from Locaweb.
I see that you are using relative urls, see if the file where you are setting include actually finds a level below the menu.php file.
– user28595
Hello Diego, it is yes; so much so that when I right click and open in new tab it opens correctly. My question is if the code is correct, or if it could be from the server, in the case Locaweb; or if I need to check if it is conflicting with some javascrip of the page.
– Felipe Silva
Another thing, why that "#" before the links? you’re using anchors?
– user28595
The site is a Onepage, I created an ID with the names, use the # to go where the excerpt of this onepage starts, would be: index.html#contact; when you click this goes to the contact part of this onepage
– Felipe Silva
In fact, anchors you reference using the "name" in the link tag. Switch to <a name="about"></a> and test.
– user28595
I’m almost sure your problem is related to javascript... it would be good to put the javascript code too
– Andrei Coelho
If you’re using these
#
to go to another corner of the Onpage I did not understand what the doubt regardingPHP
...– RFL
Good I got it! Responding to the comments: Diego, I did and it worked in this case tbm... the problem was a js identified and I will correct. Rafael this page I’m creating is a new, not part of onepage. Thanks guys for the help! It worked now.
– Felipe Silva
collapse-navation
? The class name in bootstrap would not becollapse-navigation
?– Ivan Ferrer