/    Sign up×
Community /Pin to ProfileBookmark

image fader/menu script

I have two scripts one that shows an image slide show and the other that produces menu items. The slide show worked previously but after I added my menu script it no long works. The menu script does work with the image fader. Any help would be great.

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 20000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don’t touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = ‘images/ghandi.jpg’
Pic[1] = ‘images/rubin.jpg’
Pic[2] = ‘images/buscaglia.jpg’
Pic[3] = ‘images/unknown.jpg’
Pic[4] = ‘images/Sadat.jpg’
var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}

function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter=”blendTrans(duration=2)”
document.images.SlideShow.style.filter=”blendTrans(duration=crossFadeDuration)”
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)) j=0
t = setTimeout(‘runSlideShow()’, slideShowSpeed)
}
</script>
</HEAD>
<body bgColor=”#ffffff” leftMargin=”0″ topMargin=”0″ onload=”runSlideShow()” marginheight=”0″ marginwidth=”0″>
// THIS IS THE START OF THE MENU SCRIPT.

<script language=”JavaScript”>

var languagePrefix = ”;
var urlPrefix = ”;

var urlPrefix = ‘/’;

var navLoaded = false,
navVisible = null,
nav = null;

function loadNav() {

if (!document.getElementById)
return;

if (!urlPrefix)
urlPrefix = ”;

var enNav = new Array(
new Array(‘LATEST NEWS’, ‘LatestNews.aspx’),
new Array(‘ ‘, ‘ ‘,
‘ ‘, ‘ ‘,
‘ROB BONACCORSI’, ‘Bonaccorsi.aspx’,
‘SOUL SHAKEDOWN’, ‘SoulShakedown.aspx’,
‘SHANNON ROVERS’, ‘Rovers.aspx’),
new Array()
);

//

nav = enNav;

for (var i=0; i<nav.length; i++) {

var div = document.createElement(‘DIV’);
div.className = ‘Subnav’;
div.id = ‘Subnav’+i;

var html = ‘<table border=”0″ cellpadding=”0″ cellspacing=”0″ class=”Nav”>’;

for (var x=0; x<nav[i].length; x++) {
var name = nav[i][x++];
var url = nav[i][x];

{
var className = url.split(‘/’)[0];
var fullUrl = urlPrefix + languagePrefix + url;
}

html += ‘<tr>’+
‘<td width=”205″ height=”10″ class=”Nav” align=”left”>’+
‘<a href=”‘+fullUrl+'” class=”‘+className+'”>’+
name+
‘</a></td>’+
‘</tr>’+
‘<tr><td height=”9″></td></tr>’;
}

html += ‘</table>’;

document.body.appendChild(div);
div.innerHTML = html;
}
navLoaded = true;
}

function showNav(i) {
hideNav();
if (document.getElementById)
document.getElementById(‘Subnav’+i).style.visibility = ‘visible’;
navVisible = i;
}

function hideNav() {
if (navVisible!=null)
document.getElementById(‘Subnav’+navVisible).style.visibility=’hidden’;
navVisible = null;
}

function watchNav(DOMEvent) {
if (navVisible!=null) {
var e = DOMEvent||window.event;
var y = e.pageY||e.y;
if (y>200)
hideNav();
}
}

window.onload = loadNav;
window.onload = runSlideShow();
window.onmousemove = watchNav;
</script>

The menu item is called by <a href=”band.aspx” onmouseover=”if (navLoaded) showNav(1)”>ENTERTAINMENT ></a>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@TageMar 31.2004 — you can only use window.onload once, so delete one of those and change the window.onload to
[code=php]window.onload=new Function("loadNav();runSlideShow();");[/code]

Either that or delete both and add onLoad="loadNav();runSlideShow();" to your body tag like so...
[code=php]<body onLoad="loadNav();runSlideShow()">[/code]

Hope that helps, later...
×

Success!

Help @rosieb 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.28,
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,
)...