473,383 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

using scrollBy in conjunction with frames

I've been trying to get the scrollby javascript feature to scroll
through frames. My end goal is to make my own scroll buttons to use
for navigation through the frame but I figured I would start simple.
I would load a frameset and just move the correct frame by 100 pixels
right and 100 pixels down. Here is the code I am using:
<html>
<script TYPE="text/javascript">
function scrollme()
{parent.frames[1].scrollBy(100,100)}
</script>

<FRAMESET onload="scrollme();" COLS="300,300,300">
<frame src = http://www.yahoo.com name="yahoo">
<frame src = http://www.google.com name="google">
<frame src = http://www.cnn.com name="cnn">
</frameset>
</html>
The line that really matters is of course
{parent.frames[1].scrollBy(100,100)} and I've seen (and tried) this
written many ways. It's got to be a syntax issue. I've tried:

parent.frames.yahoo.scrollBy(100,100)
parent.frames.yahoo.window.scrollBy(100,100)
parent.frames[yahoo].window.scrollBy(100,100)

and more variants. I though maybe the function wasn't running so I
replaced my frames line with alert('Test!') and the msgbox came up.
Any ideas?

Sara
Jul 23 '05 #1
2 4955
your name here wrote:
The line that really matters is of course
{parent.frames[1].scrollBy(100,100)} and I've seen (and tried) this
written many ways. It's got to be a syntax issue. I've tried:

parent.frames.yahoo.scrollBy(100,100)
parent.frames.yahoo.window.scrollBy(100,100)
parent.frames[yahoo].window.scrollBy(100,100)

<snip>

How about:

top.framename.scrollBy(100,100);
top.frames[1].scrollBy(100,100);
Jul 23 '05 #2
Ivo
"your name here" wrote
<html>
<script TYPE="text/javascript">
function scrollme()
{parent.frames[1].scrollBy(100,100)}
</script>

<FRAMESET onload="scrollme();" COLS="300,300,300">
<frame src = http://www.yahoo.com name="yahoo">
<frame src = http://www.google.com name="google">
<frame src = http://www.cnn.com name="cnn">
</frameset>
</html>


Cross-domain security measures prevent you from performing any action on
documents that are not from the very same domain as the document containing
the script. See for more info for example <
http://www.mozilla.org/projects/secu...me-origin.html >.
There is no workaround. If your page resides on Google, the above will work
because parent.frames[1] will contain a document from the same domain.
Otherwise, wait till your page shows up in their cache, and then try
again...
--
Ivo
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jawahar Rajan | last post by:
All, I have an ASP site that uses frames two frames. (yes I should be using include files, but we started ou using frames so we have been stuck with frames.) When I get a page expired warning...
2
by: Martin Mrazek | last post by:
Hi, can I manipulate with scroll bars by JS in HTML? Something like ------------------ frame1 button1: ToLeft button2: ToRight ------------------ frame2
1
by: Phoenix | last post by:
I have a site that is supposed to be 'real-time' which has a frameset of 2 rows (the bottom row is 1 pixel so essentially invisible to IE users which is the requirement for the product). The bottom...
1
by: JF | last post by:
Hi, I need to change the location of the parent window and after that scroll a little bit (because of "position:fixed" css buttons, which obscure the title). I have...
0
by: mookie | last post by:
m looking to create something similar to #region and #endregion using treeviews the problem is that instead of #region, i am using ;fold and ;endfold i am also allowed ot have a fold within...
1
by: Michi | last post by:
Hallo. I just try to implement a scrolling effect to a drag and drop script. If you try to drag something to an area beneath the visible area of your browser window, the window should scroll...
3
by: vunet.us | last post by:
Hello, I have a floating div which I drag all over the page. I want to enable window.scrollBy function when div is dragged close to top or bottom of the page, so users would drag this div to the...
1
by: vunet.us | last post by:
Hello JavaScript experts, I have a floating div which I drag all over the page. If the page has scrollbars and users drag the floating div to the very top, page scrolls up too. The problem occurs...
1
by: ccy56781 | last post by:
http://codepad.org/MV3k10AU I want to write like next one. def conjunction(number=a,name=b,size=c): flag = a==b==c if flag: for e in zip(number,name,size): print e
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.