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

Slideshow opacity

Status
Not open for further replies.

wordy2

Programmer
Mar 26, 2005
5
GB
Hello

Can anybody help me, ive been trying to change a slideshow script so that it uses opacity enabling it to work in Netscape, but I cant get it to work.
Any help or advice would be brilliant as I am on the point of giving up.
Thank you

<HTML>
<Head>
<Script Language=JavaScript>

var slideShowSpeed1 = 4000;
var slideShowSpeed2 = 6000;

var currIMG1 = 0;
var currIMG2 = 0;

var Pic1 = new Array()
Pic1[0] = 'pic/bcn1.jpg'
Pic1[1] = 'pic/bcn2.jpg'
Pic1[2] = 'pic/bcn3.jpg'

var nPix1 = Pic1.length-1;
var preLoad1 = new Array()
for (i=0; i<nPix1+1; i++)
{
preLoad1 = new Image()
preLoad1.src = Pic1
}

var Pic2 = new Array()
Pic2[0] = 'pic/bcn1.jpg'
Pic2[1] = 'pic/bcn2.jpg'
Pic2[2] = 'pic/bcn3.jpg'


var nPix2 = Pic2.length-1;
var preLoad2 = new Array()
for (n=0; n< nPix2+1; n++)
{
preLoad2[n] = new Image()
preLoad2[n].src = Pic2[n]
}

function runSlideShow1(){

SlideShow1.style.filter="blendTrans(duration=2)";
SlideShow1.filters.blendTrans.Apply();
SlideShow1.src = preLoad1[currIMG1].src;
SlideShow1.filters.blendTrans.Play();
currIMG1++
if (currIMG1 > (nPix1)){currIMG1=0}
setTimeout('runSlideShow1()',slideShowSpeed1);
}

function runSlideShow2(){

SlideShow2.style.filter="blendTrans(duration=5)";
SlideShow2.filters.blendTrans.Apply();
SlideShow2.src = preLoad2[currIMG2].src;
SlideShow2.filters.blendTrans.Play();
currIMG2++
if (currIMG2 > (nPix2)){currIMG2=0}
setTimeout('runSlideShow2()',slideShowSpeed2);
}

function init(){

runSlideShow1();
runSlideShow2();
}

window.onload=init;

</Script>
</Head>
<Body>
<img src="slideshow1_1.jpg" id='SlideShow1' width=330 height=220>
<img src="slideshow2_1.jpg" id='SlideShow2' width=330 height=220>
</Body>
</HTML>
 

What version of Netscape are you trying to get it to work in?

Also, do you want to replicate the blendTrans filter in NN, or just enable opacity?

Dan



[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]

 
Hi, thanks for the reply.

Im new to web design so forgive me if I make lots of mistakes. Basically I am testing the slideshow in Netscape 7 and it doesnt work, I assumed that NN doesnt support the blend trans filter. So ive been trying to adapt it to use opacity but cant get it to work. I really want the fade feature to work between slides on netscape, if you have any advice it would be greatly appreciated.

Thanks again
 
Check out the slideshow category at
The transparency on these ones works in NN7 (ignore any text that says it does not - I've tested it myself!)



if neither of those are your cup of tea, then I'm sure your script can be converted to be NN compatible.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
 
Hi Dan

The first dd slideshow was the one I originally wanted to use but I couldnt get 2 of them working on the same page. Ive just put a test page up so that u can see what Im trying to do It works fine in IE but netscape just freezes. If theres any way u can think of to repeat the dd script twice on the same page it would be brilliant.
 

Sorry - I'd not realised you were trying to run 2 at once (although I should have done if I'd properly read your first post!).

The DD script would need a bit of rework to enable multiple instances, but you might be able to fudge it by having 2 iframes, with each one having 1 page in with a fade script on.

How does that sound?

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]

 
Youmake it sound really easy. I played around with this script for ages but to no avail. I tried copying the script twice and changing the variables to have 2 distinct scripts but it didnt work. The more I tried to do the uglier the script became and I decided it was a bit out of my league, so I gave up.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top