Anchor Link, how to let it open at a certain page position

Asked

Viewed 2,428 times

2

Next, I’m using a page with anchor in "tabs", but when I click on the link inside the ABA it opens right more pulls to the TOP of the page the corresponding id, and so harms the MENU that is fixed on the top (because runs the page)

I would like to know if you have a way by clicking on the anchor of the link, it directs to a set position. Because what happens is he takes the div #id to the top of the browser.

This example of the flaps is the best way to explain...

http://www.sonddenge.com.br/index.html#servicos

The idea is the same

It’s like clicking on Ancora and not moving the page.... takes this function from the anchor to take the ID to the top of the browser

  • I saw that they use it... but I didn’t understand... -Webkit-user-select: None; /* Safari 3.1+ / -Moz-user-select: None; / Firefox 2+ / -ms-user-select: None; / IE 10+ / user-select: None; / Standard syntax */

2 answers

1

i usually do it by id

desired link

<a  href="test.html#id" target="_blank">NOME</a>

Address page

<div id="id">

*id-can put whatever you want, if you put it in the div contact then in the link you have to put after # contact.

0

I got,

Follow what needs to be put on BODY

	$(document).ready(function() {

		$(".service-info").hide(); 
		$("ul.services-aba li:first").addClass("services-aba-active").show();
		$(".service-info:first").show('slow');
	
		$("ul.services-aba li").click(function() {
			$("ul.services-aba li").removeClass("services-aba-active");
			$(this).addClass("services-aba-active"); 
	
			$(".service-info").hide(); 
			var activeaba = $(this).find("a").attr("href");
			$(activeaba).fadeIn('slow'); 
			return false;
		});
	
	});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.