/    Sign up×
Community /Pin to ProfileBookmark

HELP: Div/iFrame/JS Scroller

ive been trying to add a javascript scroller to my iframe on my
homepage at
[url]http://www.8dayssooner.co.uk[/url]

it should be working like this
[url]http://www.8dayssooner.co.uk/mark3b/DivScroller.htm[/url]

but currently looks like this.
[url]http://www.8dayssooner.co.uk/mark3b/[/url]

i want to keep the same visual style and positioning as my page at the
moment, but just with the new scroll bar.
i was just wondering if you could look at my source code and tell me
where im going wrong/how to fix this. this is my first time really
playing with javascript so im not too sure on what needs changing etc.
so far ive been playing with the div layers moving them around seeing
if that works, but no hope yet.
thanks

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@8dayssoonerauthorOct 09.2005 — anyone?
Copy linkTweet thisAlerts:
@8dayssoonerauthorOct 18.2005 — what a helpfull forum...
Copy linkTweet thisAlerts:
@MjhLkwdOct 18.2005 — I know I'm going to regret posting this.

[CODE]<HTML>
<Head>
<Script type="text/javascript">

var n = 0;
var currPos = 0;
var newPos = 1;
var isDiv = "";

function startScroll(){

if (newPos > currPos)
{
currPos = isDiv.scrollTop;
n = n+3; // adjust '3' for speed control
isDiv.scrollTop = n;
newPos = isDiv.scrollTop;
setTimeout('startScroll()',20) // adjust '20' for speed control
}
else {
n = 0;
currPos = 0;
newPos = 1;
setTimeout("toBottom()",2000);
}
}

function toBottom(){

isDiv = document.getElementById('div1');
isDiv.scrollTop = 0;
setTimeout('startScroll()',2000); // adjust '2000' for speed control
}

window.onload=toBottom;

</Script>
</Head>
<Body>
<Div id='div1' style='overflow:auto;border:solid black 1px;height:200px;width:350px;padding:10px;padding-bottom:10px;text-align:justify'>
U.S. Census 2000 pegged Lakewood's population at 56,646. This tally represents a 5.1% DECREASE from 1990. Lakewood is the 14th largest city in Ohio and second largest suburb in Cuyahoga County. 21% of Lakewood's population is under age 18. In racial/ethnic categories census figures show: 52,723 White (93%); 1,116 Black (1.9%); 139 American Indian; 815 Asian; 349 other; 1,504 multi-racial; 1,269 Hispanic. The 1999 effective residential property tax is $77.67 per $1,000 of tax valuation. Cuyahoga County assesses residential property at 35% of the current market value. The average sale price for a home in Lakewood for 1999, the latest year for which data is available, was $121,200. The income tax rate is 1.5%. U.S. Census 2000 pegged Lakewood's population at 56,646. This tally represents a 5.1% DECREASE from 1990. Lakewood is the 14th largest city in Ohio and second largest suburb in Cuyahoga County. 21% of Lakewood's population is under age 18.
</Div>

</Body>
</HTML>[/CODE]


I knew I'd regret it.
Copy linkTweet thisAlerts:
@8dayssoonerauthorOct 19.2005 — cheers for actually replying, but thats not what i was looking for, i want my custom scroll bar to control the iframe/div layer like a normal scrollar would.

like i said, this is the first time ive played with javascript so im not entirely sure what im doing, i jsut know how i want it working haha

thanks anyway.

*edit*

incase this helps this what my server supports

mysql

php4

perl/modperl

(www.dataflame.com for more info)
×

Success!

Help @8dayssooner spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...