04-03-2004, 05:15 PM
|
#2 (permalink)
|
| NamePros Member Join Date: Mar 2004 Location: Middle Earth (NZ)
Posts: 149
| Here is a script from http://javascript.internet.com/scrol...-scroller.html that I have modified a bit to use on an existing page it is done with layers:
| | Quote: |
<!-- COPY AND PASTE THIS CODE INTO A BLANK HTML FILE OR COPY THE RELEVANT PARTS INTO YOUR EXISTING PAGE -->
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Eddie Traversa (psych3@primus.com.au) -->
<!-- Web Site: http://nirvana.media3.net -->
<!-- This script and many more are available free online at --> ????: NamePros.com http://www.namepros.com/web-design-discussion/25582-cannot-find-script.html
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function verScroll(dir, spd, loop) {
loop = true;
direction = "up";
speed = 10;
scrolltimer = null;
if (document.layers) {
var page = eval(document.contentLayer);
}
else {
if (document.getElementById) {
var page= eval("document.getElementById('contentLayer').styl e");
}
else {
if (document.all) {
var page = eval(document.all.contentLayer.style);
}
}
}
direction = dir;
speed = parseInt(spd);
var y_pos = parseInt(page.top);
if (loop == true) {
if (direction == "dn") {
page.top = (y_pos - (speed));
} else {
if (direction == "up" && y_pos < 10) {
page.top = (y_pos + (speed));
} else {
if (direction == "top") {
page.top = 10;
}
}
}
scrolltimer = setTimeout("verScroll(direction,speed)", 1);
}
}
function stopScroll() {
loop = false;
clearTimeout(scrolltimer);
}
// End -->
</script>
</head>
<body>
<div id="contentLayer" style="position:absolute; width:250px; z-index:1; left: 39px; top: 51px">
insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !!
insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !!
insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !!
insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !!
insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !!
insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! ????: NamePros.com http://www.namepros.com/showthread.php?t=25582
insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !! insert your text here !!
</div>
<div id="scrollmenu" style="position:absolute;width:200px;height:30px;z-index:1; left:400px; top: 40px">
<table border=1><tr><td>
<table>
<tr>
<td align=left>Up</td>
<td> </td>
<td align=right>Down</td>
</tr>
<tr>
<td colspan=3>
<a href="#" onMouseOver="verScroll('up','25','true')" onMouseOut="stopScroll()"><<<</a>
<a href="#" onMouseOver="verScroll('up','5','true')" onMouseOut="stopScroll()"><<</a>
<a href="#" onMouseOver="verScroll('up','1','true')" onMouseOut="stopScroll()"><</a> |
<a href="#" onMouseOver="verScroll('dn','1','true')" onMouseOut="stopScroll()">></a>
<a href="#" onMouseOver="verScroll('dn','5','true')" onMouseOut="stopScroll()">>></a>
<a href="#" onMouseOver="verScroll('dn','25','true')" onMouseOut="stopScroll()">>>></a>
</td>
</tr>
</table>
</td></tr></table>
</div>
</body>
</html>
<!-- Script Size: 7.99 KB -->
| You could modify th elayout of the controllers to suit if you wanted images by replacing the <<<< arrows in
| | Quote: | |
<a href="#" onMouseOver="verScroll('up','25','true')" onMouseOut="stopScroll()"><<<</a>
| ... with image tags, there are more scripts similar to this on this page: http://javascript.internet.com/scrolls/
Hope this helps,
Warm Wishes,
Last edited by OneEyedDog; 04-03-2004 at 05:23 PM.
|
| |