named anchor isn't passed to iframe anymore

Page: 1

Author Post
Member
Registered: Aug 2012
Posts: 26
Hello,

we recently upgraded from version 5.3.4 to 5.7.2. Since this upgrade anchors in URLs used in fb.start aren't passed to the iframe anymore. I f.e. start a floatbox with fb.start('site.php?id=31#anchor', {caption: 'my caption' });. If I check the iframe info in firefox the URL doesn't contain the anchor anymore.

To reproduce this f.e go to
http://www.leihinstrumente.com/Guitars/Electric-Guitars/Burny-RLG-55Z-2009-HSB.html and click on "Scale length". The anchor #mensur isn't passed to the iframe in the floatbox that opens.

I'll revert to fb 5.3.4 tomorrow around midday.

best regards
Erik
Administrator
Registered: Aug 2008
Posts: 3382
Hi Eric.

Your observation is correct.

In 5.7.2 the #hash part of the url is taken as a scroll-to requests. If there is a corresponding anchor on the loaded page Floatbox will scroll the iframe to that anchor.

The #hash is removed from the URL to achieve consistent behaviour across browsers. Some browsers will attempt to scroll to the #hash element on its on and the combination of both the browser and Floatbox doing this creates problems. Removing the #hash gives consistent behaviour.

I assume the absence of the #hash creates some sort of problem for you, otherwise you would not be reverting to a previous version. I'll see if I can get clean initial scrolling to co-exist with retention of the #hash in version 6.0 which is currently on the workbench.

Cheers...
Member
Registered: Aug 2012
Posts: 26
Well, this mechanism you describe would be very nice, if it worked. But it doesn't. The culprit might be the old style empty <a name= tags. Which is no wonder, since name as anchor is deprecated as I perfectly know.
However, if I replace the <a name=... tags by <a id=... it scrolls beyond the anchor such that the headline which is below the <a tag is scrolled outside view. If I put at least a &nbsp; inside the <a tag it works as expected. This would require to go through some hundred text pages...
Administrator
Registered: Aug 2008
Posts: 3382
The Floatbox iframe scrolling is not an attempt to mimic named #hash scrolling. The #hash value is taken to be the id of an element on the page - any element of any type - and does not have to reference an <a>nchor element.

The referenced element is located using Floatbox's getLayout function, and the iframe is scrolled to the top of that referenced element. The element must put some content on the page to have layout and location.

It sounds like in the case you describe it would be best to put the id on the headline element and request a scroll to that.
Member
Registered: Aug 2012
Posts: 26
In the process of evaluating 5.7.2 again I had to realize that it doesn't work at all. I put the id on the headline element and it still doesn't scroll. I revert to 5.3.4, since there seems to be no advantage using 5.7. Hope 6.0 will work again...
Administrator
Registered: Aug 2008
Posts: 3382
5.7.2 works just fine, as can be seen from the demo page and many other sites that use it. If you're still talking about scrolling to an id when loading an iframe, you can see an example of that on the demo page of this site - Bonus2 tab, first tooltip example, click the flower.

If you're having trouble, you're more than welcome to link me in to a page that exhibits the problem and I'll help sort it out.

Cheers...
Member
Registered: Aug 2012
Posts: 26
I found the culprit. Scrolling to ID is not compatible with the resize call mentioned in the other thread. If I comment out the line
parent.fb.addEvent( window, &#039;load&#039;, function () {parent.fb.resize();} );
it works.

Page: 1