1
I got the following li
<li class="madmaxmenu">
<a href="#mad-max">Mad Max</a>
</li>
and the following Jquery
$("li.madmaxmenu").click(function() {
$('html,body').animate({
scrollTop: $("#madmax").offset().top - 120},
'slow');
});
I mean, when I click on li it goes straight to the Ction that I informed and already informs the href in the address bar.
For example: http://madmax.com.br/#Mad-max
And if I want when the user type http://madmax.com.br/#Beyond-the-Thunderdome in the address bar, it goes directly to that Action, without having to click on the menu, how? Do the same process as if he had clicked on li in question. Website http://madmax.com.br
He’ll do that if you use one
id
instead of aclass
. For example if you have a link or a linkli
thus:<li id="beyond-the-thunderdome">
instead of a class, when the user accesses the site using the example link from thishttp://madmax.com.br/#beyond-the-thunderdome
, when loaded the page, it will automatically "skip" to that section with thatid
. These are called "anchor links".– Chun
But I would have to inform the id where?
– Felipe Viero Goulart