Link Anchors, how to let it open in a certain position of the page

2

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

I wonder if you have a click on the anchor of the link, it directs you to a defined position. Well what happens is he takes the div #id to the top of the browser.

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

link

The idea is the same

It's like clicking on the Ancora or even moving the page .... take this function from the anchor to take the ID to the top of the browser

    
asked by anonymous 28.03.2018 / 04:50

2 answers

1

I usually do this for id

Desired link

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

Targeting page

<div id="id">

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

    
28.03.2018 / 12:16
0

I got it,

Here's what needs to be put into 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;
		});
	
	});
    
30.03.2018 / 03:23