I've a site where it's much navigating inside the insertFrame window, witch results in a lot of scrolling up when clicking on a link a bit down on the site, since the insertFrame window doesn't target the top of the new destinationlink. The users have to scroll all the way up to get where they want because the site often has links in the bottom of the page, witch leaves the destination target in the same position as the site they left. Hope you understand, a bit bad english perhaps.

Comments

MarcElbichon’s picture

Can you post screenshots of the problem ?

per-olav’s picture

StatusFileSize
new405.66 KB
new256.37 KB

Picture 1 shows the link at the bottom of a page inside insertFrame. Picture 2 is just blank because the target link isn't at the top where the text continues, but at the bottom like the first page witch is much higher in pixels than the second page. To get to the text you have to scroll to the top.

MarcElbichon’s picture

How do you declare your frame ([[[ ... ]]]) ?
I don't think this is an insertFrame bug, but more a browser bug.
If you haven't set height to 100%, generated code is a standard html code for iframe.
If you replace insertFrame tags with complete HTML code, i think you will have the same problem.

per-olav’s picture

Hi

I'm using this "[[[ width=100% height=100% scrolling=no]]]". Maybe I'm missing something here?

MarcElbichon’s picture

Url is not present.
You have to do [[[ url width=100% height=100% scrolling=no ]]]

Auto height setting is on so, scrollbar shoud'nt be visible.
Is your url accessible from internet to have a look on generated code ?

per-olav’s picture

I've [[[ url width=100% height=100% scrolling=no ]]], just removed the url, but here you go: http://www.lofot-slekt.net/bygdebok

Try navigate, and you will see that you always stay at the same height when you press a link inside the frame.

MarcElbichon’s picture

StatusFileSize
new323 bytes

This works on IE but not in FireFox (and chrome).
Can you add a doctype to the iframed page.
I've changed javascript code.
Can you replace insertFrame.js in insertFrame directory by attachment ?

MarcElbichon’s picture

StatusFileSize
new323 bytes

Sorry, there's a bug with precedent attachement.
Use following

MarcElbichon’s picture

According to this article http://stackoverflow.com/questions/1353727/calculating-automatic-iframe-..., autoheight does'nt work in Quirks Mode (without doctype). You must add a doctype like to make autoheight working.

per-olav’s picture

Thanks!

I've downloaded the file and replaced it. Just copied the doctype used in the link you posted (<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""w3.org/TR/html4/strict.dtd" >) and placed it right over the insertFrame code. Now the frame almost does what I want it to do in FireFox 4 (IE9 and Chrome don't work at all). No blank page any more, but it doesn't load at the top of the page though. Any thoughts?

MarcElbichon’s picture

Doctype must be placed into pages shown in the iframe (vestvaagoey.htm,innhold_for_buksnes.htm, ...) to make all browser working.
To scroll iframe to top can you replace javascript function by

function adjustHeight(obj, offset) {
	var helpFrame = jQuery("#" + obj.name);
	var innerDoc = (helpFrame.get(0).contentDocument) ? helpFrame.get(0).contentDocument : helpFrame.get(0).contentWindow.document;
  if(jQuery.browser.msie) { 
    helpFrame.height(innerDoc.body.scrollHeight + offset);
  }
  else {
    helpFrame.height(innerDoc.body.offsetHeight + offset);
  }
  helpFrame.scrollTop();
	
}

per-olav’s picture

Well, I've added the doctype to both "vestvaagoey.htm" and "innhold_for_buksnes.htm", and replaced the javascript function in insertFrame.js, but don't see any changes. Did I misunderstand something?

Again, thanks for helping!

MarcElbichon’s picture

You need to add doctype to ALL pages of your site.
To scroll to top, replace in insertframe.js

helpFrame.scrollTop();

by

jQuery('html, body').animate({scrollTop:0}, 'fast');
per-olav’s picture

Status: Active » Closed (fixed)

Thanks, it worked! Just inserted the doctype in a couple of the pages to test. I really appreciated the support, and once again thank you :)