Click to See Complete Forum and Search --> : Help, need a scrolling navigation script
damon2003
09-28-2003, 08:15 AM
Hi,
I need to create a navigation bar. When the user goes to a page they see a a horizontal row of logos line up together, each representing a link. However, because there are more links than will fit on the page, there are left and right arrows. When the user's mouse hovers over an arrow the navigation will scroll either left or right so that any hidden links that could not be displayed now come into view,
does anyone have a script that performs this or something similar?
thanks a lot
Khalid Ali
09-28-2003, 09:26 AM
Good luck with free consulting search..it would have been more appropriate if you actually tried to write your own code and posted here a specific question rahter then expecting some one to spoon feed you.
damon2003
10-02-2003, 05:12 AM
Ok this is what I already have, see below:
http://www.worldconnects.net/menu.htm
However, its not perfect, there are gaps between the blocks of graphics and also if you look carefully, at the red square graphic for example, you will see that there is an thin overlap of colour on the left and top of this image, which I want to get rid off, any ideas?
thanks a lot
damon2003
10-02-2003, 05:16 AM
heres the code, use the left and right pointers to scroll left or right
<style>
body{
overflow-x:hidden;
overflow-y:scroll;
}
</style>
<script language="JavaScript1.2">
//configure path for left and right arrows
var goleftimage='pointer2.gif'
var gorightimage='pointer.gif'
//configure menu width
var menuwidth=300
//configure menu height
var menuheight=100
//configure scroll speed (1-10), where larger is faster
var scrollspeed=6
//specify menu content
var menucontents='<nobr> <a href="http://link.com"><img src="a.gif" alt="link.com"></a> <a href="http://anotherlink.com"><img src="a.gif" alt="link.com"></a> <a href="http://link.com"><img src="aa.gif" alt="link.com"></a></nobr>'
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+menucontents+'</span>')
var actualwidth=''
var cross_scroll, ns_scroll
var loadedyes=0
function fillup(){
if (iedom){
cross_scroll=document.getElementById? document.getElementById("test2") : document.all.test2
cross_scroll.innerHTML=menucontents
actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("temp").offsetWidth
}
else if (document.layers){
ns_scroll=document.ns_scrollmenu.document.ns_scrollmenu2
ns_scroll.document.write(menucontents)
ns_scroll.document.close()
actualwidth=ns_scroll.document.width
}
loadedyes=1
}
window.onload=fillup
function moveleft(){
if (loadedyes){
if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){
cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed
}
else if (document.layers&&ns_scroll.left>(menuwidth-actualwidth))
ns_scroll.left-=scrollspeed
}
lefttime=setTimeout("moveleft()",50)
}
function moveright(){
if (loadedyes){
if (iedom&&parseInt(cross_scroll.style.left)<0)
cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed
else if (document.layers&&ns_scroll.left<0)
ns_scroll.left+=scrollspeed
}
righttime=setTimeout("moveright()",50)
}
if (iedom||document.layers){
with (document){
write('<table border="0" cellspacing="0" cellpadding="0">')
write('<td valign="middle"><a href=#" onMouseover="moveleft()" onMouseout="clearTimeout(lefttime)"><img src="'+goleftimage+'"border=0></a> </td>')
write('<td valign="top">')
if (iedom){
write('<div style="position:relative;width:'+menuwidth+';">')
write('<div style="position:absolute;width:'+menuwidth+';height:'+menuheight+';overflow:hidden;">')
write('<div id="test2" style="position:absolute;left:0;top:0">')
write('</div></div></div>')
}
else if (document.layers){
write('<ilayer width='+menuwidth+' height='+menuheight+' name="ns_scrollmenu">')
write('<layer name="ns_scrollmenu2" left=0 top=0></layer></ilayer>')
}
write('</td>')
write('<td valign="middle"> <a href="#" onMouseover="moveright()" onMouseout="clearTimeout(righttime)">')
write('<img src="'+gorightimage+'"border=0></a>')
write('</td></table>')
}
}
</script>