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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

beginner. custom scrolling?

Status
Not open for further replies.

spungemad

Technical User
Mar 14, 2007
2
GB
well, i am a total beginner to web design of any sort and ive just used a variety of programmes to get to the stage i am at now.see>
and i have the idea of having custom scrollbars (using the pictures shown on the righthand side on the website).

i think i may have to do it in javascript, would that be right?

also is there any easy (lazy) way to do it?


andy advice would be greatful,
thanks,
Emma
 
spungemad said:
i think i may have to do it in javascript, would that be right?
Yes.

spungemad said:
also is there any easy (lazy) way to do it?
Even better, there's a whole tutorial on it:

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Enable Apps
 
thanks a lot for that. Im sorry i didnt make it more clear but i was thinking more of two arrows, one for up, one for down.


however if its not possible i will use what you suggested as a backup.

thanks again
 
It's certainly possible... and quite easy if you read the tutorial.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
<style type="text/css">
#contentArea {
	height: 200px;
	width: 200px;
	overflow: hidden;
	position: absolute;
}
#content {
	top: 0px;
	width: 200px;
	position:relative;
}
#scrollArea {
	height: 200px;
	width: 50px;
	position: absolute;
	left: 250px;
}
#scrollUp {
    height: 50px;
	margin-bottom:50px;
}
#scrollDown {
	height: 50px;
	margin-top:100px;
}
</style>
<script type="text/javascript" language="javascript">
function scroll(strDirection){
	var currTop = document.getElementById("content").offsetTop;
	var increment = (strDirection == 'down' ? -50 : 50);
	document.getElementById("content").style.top = (currTop + increment) + "px";
}

</script>
</head>

<body>
<div id="contentArea">
<div id="content">
This is the top
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis. 
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
Dominus Deus qui ductor est vester pro vobis ipse pugnabit sicut fecit in Aegypto videntibus cunctis.
</div>
</div>
<div id="scrollArea">
<div id="scrollUp"><a href="#" onclick="scroll('up'); return false;">^</a></div>
<div id="scrollDown"><a href="#" onclick="scroll('down'); return false;">v</a></div>
</div>
</body>

</html>

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Enable Apps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top