PDA

View Full Version : Horizontal image scroller


shernoam
06-16-2001, 06:36 AM
Hi people...!
Doe's anybody knows where can I find a
horizontal image scroller (Javascript/dHtml...)?

I mean somthing like:
http://www.aist.com/international/index.html
look at the top scrolling menu... ?

petervazed
06-16-2001, 10:50 AM
It is possible to "save as":
http://www.aist.com/international/top.html
There are 5 JS files needed like you then can see.
Then you can use it with your own images.

shernoam
06-16-2001, 12:24 PM
Yes but I want something else because it's a bad script... (Bugs...)

Look at this can someone tell me how to change the distant between the images:


<HTML><HEAD><TITLE>Ch</TITLE>
</HEAD>
<HEAD>
<!-- --><style>
body{background-color:#FFFFFF}
A{color:Navy; text-decoration:none}
A:hover{color:red}
A:visited:{color:#808080}
TD{font-family:arial,helvetica; font-size:10pt}
#divBg{position:absolute; z-index:10; width:200; left:0; height:100; clip:rect(0,10,10,0)}
#divMenu{position:absolute; left:15; top:6; font-weight:bold}
#divArrowLeft{position:absolute; width:20; height:20; left:0; top:9}
#divArrowRight{position:absolute; width:20; height:20; top:9}
</style><!-- -->













<script>
/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts.
This may be used freely as long as this msg is intact!
********************************************************************************/
//Simple browsercheck
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;

/**************************************************************************
Variables to set.
***************************************************************************/
//The height of the menu
menuHeight=96

//Width of the arrows
arrowWidth=16

//Scroll speed: (in milliseconds, change this one and the next variable to change the speed)
scrollSpeed=0
//Pixels to scroll per timeout.
scrollPx=7

/**************************************************************************
Scrolling functions
***************************************************************************/
var tim;
var noScroll=true
function mLeft(){
if(!noScroll && oMenu.x<arrowWidth){
oMenu.moveBy(scrollPx,0)
tim=setTimeout("mLeft()",scrollSpeed)
}
}
function mRight(){
if(!noScroll && oMenu.x>-(oMenu.scrollWidth-(pageWidth))-arrowWidth){
oMenu.moveBy(-scrollPx,0)
tim=setTimeout("mRight()",scrollSpeed)
}
}
function noMove(){clearTimeout(tim); noScroll=true}
/**************************************************************************
Object part
***************************************************************************/
function makeObj(obj,nest,num){
nest=(!nest) ? '':'document.'+nest+'.'
this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style')
this.evnt=(n)? eval(nest+'document.'+obj):eval(obj);
this.scrollWidth=n?this.css.document.width:this.evnt.offsetWidth
this.x=(n)? this.css.left:this.evnt.offsetLeft; this.y=(n)? this.css.top:this.evnt.offsetTop;
this.moveBy=b_moveBy; this.moveIt=b_moveIt; this.showIt=b_showIt;this.clipTo=b_clipTo;
return this
}
function b_moveBy(x,y){this.x=this.x+x; this.y=this.y+y; this.css.left=this.x; this.css.top=this.y}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}
function b_clipTo(t,r,b,l){
if(n){this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l
}else this.css.clip="rect("+t+","+r+","+b+","+l+")";
}
function b_showIt(){this.css.visibility="visible"}
/**************************************************************************
Object part end
***************************************************************************/

/**************************************************************************
Init function. Set the placements of the objects here.
***************************************************************************/
function side_init(){
//Width of the menu, Currently set to the width of the document.
//If you want the menu to be 500px wide for instance, just
//set the the pageWidth=500 in stead.
pageWidth=500

oBg=new makeObj('divBg')
oMenu=new makeObj('divMenu','divBg')
oArrowRight=new makeObj('divArrowRight','divBg')
//Placement
oBg.moveIt(0,0) //Main div, holds all the other divs.
oMenu.moveIt(arrowWidth,6)
oArrowRight.moveIt(pageWidth-arrowWidth,9)
//setting the width and the visible area of the links.
if(ie){ oBg.css.width=pageWidth; oBg.css.overflow="hidden"}
oBg.clipTo(0,pageWidth,menuHeight,0)
}

//executing the init function on pageload.
onload=side_init;
</script>


















<!-- --><div id="divBg">
<div id="divMenu">
<table><tr><td nowrap>
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *
[<a href="#"><IMG src="img/AlenKick.JPG"></a>] *

</td></tr></table>
</div>
<div id="divArrowLeft"><a href="javascript://" onmouseover="noScroll=false; mLeft()" onmouseout="noMove()"><img src="leftarrow.gif" width=16 height=24 border=0></A></div>
<div id="divArrowRight"><a href="javascript://" onmouseover="noScroll=false; mRight()" onmouseout="noMove()"><img src="rightarrow.gif" width=16 height=24 border=0></a></div>
</div><!-- -->

</HTML>

Dr. Web
06-16-2001, 01:12 PM
as in the distance between the scroll arrows?
Yes, change the pagewidth. If its the scrolling letters you want to change, yod have to get into the style declarations... which you did not post.

shernoam
06-16-2001, 01:57 PM
I ment the distance between the pictures...
I really don't know what to do... could you show me the html code...?

Dr. Web
06-16-2001, 07:23 PM
that script has two arrows, and in between them is the alphabet of letters. Do you mean the distance between the left arrow and the right one? OR the distance between letter a and letter b?

shernoam
06-17-2001, 04:46 AM
between letters...

Dr. Web
06-17-2001, 01:12 PM
ok, just post the stuff in the header.... the <style> stuff and I'll make the changes

shernoam
06-17-2001, 02:17 PM
the script is also in "a1javascripts" but ok:



<!-- --><style>
body{background-color:#FFFFFF}
A{color:Navy; text-decoration:none}
A:hover{color:red}
A:visited:{color:#808080}
TD{font-family:arial,helvetica; font-size:10pt}
#divBg{position:absolute; z-index:10; width:200; left:0; height:100; clip:rect(0,10,10,0)}
#divMenu{position:absolute; left:15; top:6; font-weight:bold}
#divArrowLeft{position:absolute; width:20; height:20; left:0; top:9}
#divArrowRight{position:absolute; width:20; height:20; top:9}
</style><!-- -->

Dr. Web
06-17-2001, 10:07 PM
didn't see that style, turned out I just removed the '[' and ']', as well as all the spaces inbetween the <a href></a> tags.

shernoam
06-18-2001, 04:41 AM
thanx!!!
you helped me man thanx!!!
thanx!!!thanx!!!thanx!!!thanx!!!thanx!!!

;)

Dr. Web
06-18-2001, 06:41 PM
no problem!