Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 autoscroll i-frame
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

1user2
Novice

2 Posts

Posted - 27 Jan 2008 :  11:00:20  Show Profile  Visit 1user2's Homepage  Reply with Quote
who can solve the following "problem" ?
I made a page with an i-frame, incl. colored scrollbar - no problem.
Now I want to hide the scrollbar completely and make the i-frame scrolling by mouse-over and mouse-out to an image(arrow up and arrow down)
By my knowledge I'll have to do this with a correct javascript, but I am not a java programmer :)
Who can help me ?

s.dav
Site Admin

Italy
3364 Posts

Posted - 28 Jan 2008 :  09:12:52  Show Profile  Visit s.dav's Homepage  Reply with Quote
Try the follows:
1- add this style to the body tag (by creating a "style" tag into the header code of the page inserted into the iframe)

<style type="text/css">
body {overflow:hidden;}
</style>

no tried but it should hide scrollbars

The IFRAME tag itself has some properties that will permit you to hide scrollbars if the style trick doesn't work

2- the code that will permit the page to scroll should be a thing like this:

document.offsetTop=xxx;

so for scrolling down:

document.offsetTop+=5;

up:

if (document.offsetTop>5)
document.offsetTop-=5;
else
document.offsetTop=0;


You can use the Javascript setTimeOut function to recall a javascript function after some time.

no tested but it should work.

Regards, Davide
Go to Top of Page

1user2
Novice

2 Posts

Posted - 30 Jan 2008 :  15:32:23  Show Profile  Visit 1user2's Homepage  Reply with Quote
thnx Dav.
The "style"tag works but I don't know how to go on with the rest, sorry
Go to Top of Page

s.dav
Site Admin

Italy
3364 Posts

Posted - 31 Jan 2008 :  09:55:10  Show Profile  Visit s.dav's Homepage  Reply with Quote
You have to:
1- create a script block on the header of the page contained into the IFRAME
put into it two functions

<script>
function goDown()
{
document.offsetTop+=5;
}
function goUp()
{
if (document.offsetTop>5)
document.offsetTop-=5;
else
document.offsetTop=0;
}
</script>

2- create the down and up arrows
3- assign event to arrows, choose "onClick", "JavaCall", "goDown();"

Regards, Davide
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000