Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames controler

Status
Not open for further replies.

yock

Programmer
Nov 4, 2001
9
0
0
US
well its hard to explain with no example....it is done in frames...ex: there are 2 frames one on top and one on bottom the top one will have a picture that is roughly 4500pixles wide the bottom one will have a navagation area in it to control the scrolling of the top frame without the use of a scrollbar.....if i'm not explaining this well enough let me know...the navagation will be done using an image map. well...on the event that someone clicks a button(which will be part of a image map) it will make the entire frame move to the left or to the right depending on the button clicked... something a long the lines of on event scroll+500 or on event click scroll -500 something like that, this would then trigger the above page to move to right or to the left...the reason for no scroll bar is to give it some style and fuctionality....just for looks...i hope i'm explaining this well enough...i only have a very basic understanding of javascript so creating this script is way out of my league but i have seen it done before...so i know its possible

 
Try the link first:

<a href=javascript:parent.ImageFrame.scrollBy(100, 0)>Scroll horizontally</a>

ImageFrame is a name/id of the frame with image. You can use &quot;parent.ImageFrame.scrollBy(100, 0)&quot; with different parameters as a value specified for such events as &quot;onclick&quot; for image, for example.

Scrolling works ok in IE, do not know about other browsers. Vlad Grynchyshyn, MVP
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
ok what does parent in javascript:parent.ImageFrame.scrollBy(100,0) stand for?
 
Using &quot;parent&quot; you can access the farmeset window that contains your 2 frames (top and bottom). Through it you manipulate frames and access their properties, methods, objects, events etc.

Vlad Grynchyshyn, MVP
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
thx for your help btw, well i found something that would add to the effect of the scrolling.

<script type=&quot;text/javascript&quot;>
function scrolldown()
{

for (i=1; i<=600; i++)
{
window.scroll(1,i)
}
}
</script>
i know the function scroll down would probably be omitted but i am trying to understand how i would encorperate this into the rest of the script. any suggestions?
 
<a href=javascript:parent.ImageFrame.scrolldown()
>Scroll horizontally</a>

And put mentioned script as a part of the HTML document for ImageFrame frame. Vlad Grynchyshyn, MVP
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
success...it works great..thx a lot
 
<script type=&quot;text/javascript&quot;>
()
{

for (i=1; i<=600; i++)
{
window.scroll(i,1)
}
}
</script>
 
is there a way i could ad an onclick=&quot;scroll()&quot; option somewhere to trigger this effect?
 
Yes. Using &quot;A&quot; tag - you already seen this above. Do not know if this will work in Netscape, but try following example:

<IMG SRC=MyImage.gif onclick=&quot;parent.ImageFrame.scrolldown()
&quot;> Vlad Grynchyshyn, MVP
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
i keep getting a stack overflow on the

window.scroll(i,1)

line? i changed it slightly to get it to put off the effect from teh right to left instead of down
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top