Anchor links seem to reload page

Page: 1

Author Post
Member
Registered: Aug 2013
Posts: 4
Hi
I use FB to show some pages on a Joomla site. Some of the pages opened in floatbox contains achor links to notes in the bottom of them, but when pressed the anchor link reloads the entire page in FB before it scrolls down to the bottom of the page. Can this be prevented?
Administrator
Registered: Aug 2008
Posts: 3382
I'll probably need to see this page in action to sort it out.

If the content page is coming in as ajax then I would expect the behaviour you are seeing. If the page is coming in as an iframe then the navigation should remain within that iframe when a link is clicked.

There's not much more I can say without looking at it.
Member
Registered: Aug 2013
Posts: 4
Wauw, that was fast :) Thanks.

The site privatskoleforeningen.dk (for which the license has been bought) is being worked on here:
ink01.dk/danmarks-privatskoleforening/23-presse/307-vaerdierne

The first link: "At vaere en fri privat grundskole - hvad betyder det?" opens a page in FB. Near the bottom there are three notes 1,2 and 3 that are anchored in the text. They reload the page and disregards that the menu is not supposed to load in FB.
« Last edit by Krull on Thu Aug 08, 2013 1:51 pm. »
Administrator
Registered: Aug 2008
Posts: 3382
Ok, I'm into the page. But those three paragraphs at the bottom aren't links. They are just three numbered text paragraphs. When I click on them, nothing happens. What am I missing?
Member
Registered: Aug 2013
Posts: 4
Yes, but they each has an anchor and the numbers, or at least 1 and 2, are linking to them in the text just above.
Administrator
Registered: Aug 2008
Posts: 3382
Ah, ok, I found those tiny little links.

Everything looks ok to me. Those are #hash links to named anchors. When I click them the browser scrolls those paragraphs containing the named anchors into view within the iframe that's showing in the floatbox. If the referenced anchor is already in view, nothing happens. Is it doing something different for you or are you trying to do something different with those links?
Member
Registered: Aug 2013
Posts: 4
As you can see here http://www.screencast.com/t/RDej6XP2NtVB

When I do it the page don't scroll down it reloads and thereby adding the menu's that is not part of the 'popup'css' ... that's my problem :?
Administrator
Registered: Aug 2008
Posts: 3382
I don't think I can be of any assistance with this. It's just the browser responding to the link click as it sees fit. While Floatbox is in use on the page, it is not interfering with or manipulating the link or its behaviour in any way.

The root of the problem appears to be that the iframe page has a query-string on it, but this is not present in the browser's expansion of the link. In particular, the iframe source is
http://ink01.dk/danmarks-privatskoleforening/299-leksika/presse/informationer-til-pressen/322-at-vaere-en-fri-privat-grundskole-hvad-betyder-det?tmpl=component&popup=1&layout=default
with the query-string present.

If we right click on that small [1] link in Chrome and select "copy link address", we get
http://ink01.dk/danmarks-privatskoleforening/299-leksika/presse/informationer-til-pressen/322-at-vaere-en-fri-privat-grundskole-hvad-betyder-det#nr1

Note the absence of the query-string on that link. The browser interprets the link as going to a different page and so loads that different page.

This is all browser behaviour and I don't know how to alter or adjust it.
Administrator
Registered: Aug 2008
Posts: 3382
Aha! Since formulating my previous reply, I took a closer look at your content. You have a <base> element in the document head which causes all links in the document to be relative to the base href, and not relative to the current page. Hence your #hash references refer to a name or id on the base-referenced document, not on the currently displayed document.
<base href="http://ink01.dk/danmarks-privatskoleforening/299-leksika/presse/informationer-til-pressen/322-at-vaere-en-fri-privat-grundskole-hvad-betyder-det">

Page: 1