Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
07-18-2011, 11:32 PM #1
- Join Date
- Jul 2011
- Thanked 0 Times in 0 Posts
Scroll cross-domain frames in FF5
I am working on a webpage that has some frames that contain webpages that are on other servers. Some of the frames are smaller than the webpages that they contain; also, some of these embedded webpages may start out at named anchors (
http: //site.com/#anchor_name) which result in the content being scrolled to the right.
I would like to scroll each frame, as soon as that frame first finishes loading, in one of a few ways: all the way to the left, all the way to the right, or leaving the default horizontal position.
At this time, the only browser I need to support is Firefox 5.
As suggested in http://stackoverflow.com/questions/1...omment-6499395 I have produced a main and a subsidiary HTML file.
I think the problem is finding an object syntax that can scroll one frame in my setup. For example:
I can consider a different approach than the one described in the stackoverflow.com article above, but I prefer that it be simple. I do not have access to the embedded webpages to change them.
Simplified versions of my 2 HTML files are as follows. The real "main.html" will eventually have several nested framesets, some with the contents stacked one above the other (
rows=) and some with the contents arranged left to right (
getSearchParamis a helper function to decode the part of the URL after the question mark ("?"). For clarity, I left this function out of the code listing. The function is similar to the one at http://stackoverflow.com/questions/5...#answer-523293 or you can hard-code
"L"in place of
getSearchParam("s")if you want to test the above HTML.
It is fine if the call to
scrollBy()is in "main.htm" instead of "frame_shim.htm." I have tried putting it in both files, and in both cases I haven't found an object reference syntax that works.
Thanks in advance for suggestions.