Hi
Can a html link open a floatbox window and automatically jump/scroll down to the referenced target section of the new page
I tried the following code but it didn't seem to work
Can you advise me of the correct codes
On page1.html:
<a name="appendix1"></a>
On page2.html:
<div class="floatbox">
<a href="page1.html#appendix1">appendix</a>
</div>
Thanks David D
Targetted Links
Page: 1
Author | Post |
---|---|
#1 Tue Jun 18, 2013 9:15 am
|
|
Member
Registered: Aug 2012
Posts: 22
Location: Bondi Beach Sydney Australia
|
|
#2 Tue Jun 18, 2013 9:21 am
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
Yes, but it will not scroll to a named element. It looks for an element with the specified id. If you change name="appendix1" to id="appendix1" it should work.
|
#3 Tue Jun 18, 2013 11:01 am
|
|
Member
Registered: Aug 2012
Posts: 22
Location: Bondi Beach Sydney Australia
|
Hi i changed on page1,
<a name="appendix1"></a> to <div id="appendix1"></div> On page2, if I right click the link > open in new window > then the page will jump to the appendix1 'morsel of lore' But when I left click normally on the link The floatbox window wont jump to the appendix section On some occasions it will tho but mostly it wont I tried spam clicking the link and got mixed results http://www.theringoflight.com/noveltrol/pages/testpage2.html http://www.theringoflight.com/noveltrol/pages/testpage1.html I am not experienced in html Could you advise me on any code changes I should change thanks! |
#4 Wed Jun 19, 2013 4:31 am
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
There's a timing problem in the current Floatbox code. Two things are being loaded simultaneously - the animated opening of the floatbox components and the fetching of the iframe content. If the box load completes before the iframe load, scrolling to the #id can fail because the code will attempt a scroll to an element that is not yet present.
I've got this situation fixed in version 6.0.0. It will scroll reliably because it will always wait until both the iframe and the floatbox are complete. You can get reliable scrolling to an #id in the current version by not assigning a "height" option to the floatbox starter. When no height option is provided, the content will be measured, and to be measured it must be fetched before being displayed. Thus removing "height" from you example will guarantee that the iframe is fully loaded and present prior to the floatbox being drawn, and the scrolling should be reliable. |
#5 Wed Jun 19, 2013 5:23 am
|
|
Member
Registered: Aug 2012
Posts: 22
Location: Bondi Beach Sydney Australia
|
Ok cool thanks for the information!
|
Page: 1