/    Sign up×
Community /Pin to ProfileBookmark

multiframe image slideshow problem

Hi,
i’m hoping someone will be able to help me out with a problem i am having. I am trying to create an multiframe image slideshow that displays 3 horizontal images, which are hyperlinked. here is the code below:

[I]<script type=”text/javascript”>
//<![CDATA[
/***********************************************
*
MultiFrame Image Slideshow script- © Dynamic Drive DHTML code library ([url]www.dynamicdrive.com[/url])
* This notice MUST stay intact for legal use
*
Visit Dynamic Drive at [url]http://www.dynamicdrive.com/[/url] for full source code
**
*********************************************/
var seqslides=new Array()
//Set Path to Image plus optional URL (“” for no URL):
seqslides[0]=[“http://www.perfect.es/produccion/bni2/uploads/wsi1.jpg“, “http://www.itswsi.co.uk“]
seqslides[1]=[“http://www.perfect.es/produccion/bni2/uploads/artichoke1.jpg“, “http://www.artichokedesignstudios.com“]
seqslides[2]=[“http://www.perfect.es/produccion/bni2/uploads/audi1.jpg“, “http://www.listersgroup.co.uk“]
seqslides[3]=[“http://www.perfect.es/produccion/bni2/uploads/bms1.jpg“, “http://www.bmshomes.co.uk“]
seqslides[4]=[“http://www.perfect.es/produccion/bni2/uploads/ccl1.jpg“, “http://www.ccldesigns.net“]
seqslides[5]=[“http://www.perfect.es/produccion/bni2/uploads/chamber1.jpg“, “http://www.bci.org.uk“]
seqslides[6]=[“http://www.perfect.es/produccion/bni2/uploads/churchill1.jpg“, “http://www.cos.uk.com“]
seqslides[7]=[“http://www.perfect.es/produccion/bni2/uploads/clive1.jpg“, “http://www.cliveblair.co.uk“]
seqslides[8]=[“http://www.perfect.es/produccion/bni2/uploads/doctor1.jpg“, “http://www.commercialdoctor.com“]
seqslides[9]=[“http://www.perfect.es/produccion/bni2/uploads/dukes1.jpg“, “http://www.dukesmedia.com“]
seqslides[10]=[“http://www.perfect.es/produccion/bni2/uploads/feltons1.jpg“, “http://www.feltonsbham.co.uk“]
seqslides[11]=[“http://www.perfect.es/produccion/bni2/uploads/firework1.jpg“, “http://www.fireworksfactory.demon.co.uk“]
seqslides[12]=[“http://www.perfect.es/produccion/bni2/uploads/golf1.jpg“, “http://www.livinggolf.co.uk“]
seqslides[13]=[“http://www.perfect.es/produccion/bni2/uploads/hart1.jpg“, “http://www.hartrecruitment.co.uk“]
seqslides[14]=[“http://www.perfect.es/produccion/bni2/uploads/icon1.jpg“, “http://www.iconexhibitions.co.uk“]
seqslides[15]=[“http://www.perfect.es/produccion/bni2/uploads/interactive1.jpg“, “http:..www.interactivecontrol.co.uk”]
seqslides[16]=[“http://www.perfect.es/produccion/bni2/uploads/interlinx1.jpg“, “http://www.interlinx.co.uk“]
seqslides[17]=[“http://www.perfect.es/produccion/bni2/uploads/millfield1.jpg“, “http://www.millfield-partnership.co.uk“]
seqslides[18]=[“http://www.perfect.es/produccion/bni2/uploads/monochrome1.jpg“, “http://www.monochrome-express.co.uk“]
seqslides[19]=[“http://www.perfect.es/produccion/bni2/uploads/nlp1.jpg“, “http://www.nlpbirminghamforum.co.uk“]
seqslides[20]=[“http://www.perfect.es/produccion/bni2/uploads/optimal1.jpg“, “http://www.optimalprofit.com“]
seqslides[21]=[“http://www.perfect.es/produccion/bni2/uploads/recognition1.jpg“, “http://www.re-bhamsol.co.uk“]
seqslides[22]=[“http://www.perfect.es/produccion/bni2/uploads/signs1.jpg“, “http://www.signsnow.co.uk“]
seqslides[23]=[“http://www.perfect.es/produccion/bni2/uploads/young1.jpg“, “http://www.younglee.co.uk“]
//Set pause between each image display (2000=2 second):
var slidedelay=3000
//Set how many images to show at once (must be less than total # of images above):
var slidestoreveal=3
//Specify code to insert between each slide (ie: “<br>” to insert a line break and create a vertical layout)
//”” for none (or horizontal):
var slideseparater=””
//Set optional link target to be added to all images with a link:
var optlinktarget=”secwindow”
//Set image border width:
var imgborderwidth=0
//Set opacity value of each image when it’s “dimmed”, and when it’s not, respectively (1=100% opaque/normal).
//Change 0.2 to 0 to completely hide image when it’s dimmed:
var opacityvalues=[0.75,1]
///No need to edit beyond here///////////
function processimgcode(theimg){
var imghtml=””
if (theimg[1]!=””)
imghtml='<a href=”‘+theimg[1]+'” target=”‘+optlinktarget+'”>’
imghtml+='<img src=”‘+theimg[0]+'” border=”‘+imgborderwidth+'” style=”filter:alpha(opacity=’+(opacityvalues[0]*
100)+’);-moz-opacity:’+opacityvalues[0]+'”>’
if (theimg[1]!=””)
imghtml+='</a>’
return imghtml
}
var curslide=0 //var to track current slide (total: slidestoreveal)
var curimgindex=0 //var to track current image (total: seqslides.length)
var isfirstcycle=1 //boolean to indicate whether this is the first cycle
if (document.getElementById){
for (i=0;i<slidestoreveal;i++)
document.write(‘<span id=”seqslide’+i+'” class=”seqslidestyle”>’+processimgcode(seqslides[i])+'</span>’+slideseparater)
curimgindex=slidestoreveal
illuminateslide(0,opacityvalues[1])
}
function illuminateslide(slideindex, amt){
var slideobj=document.getElementById(“seqslide”+slideindex).getElementsByTagName(“IMG”)[0]
if (slideobj.filters)
slideobj.filters.alpha.opacity=amt*100
else if (slideobj.style.MozOpacity)
slideobj.style.MozOpacity=amt
}
function displayit(){
if (curslide<slidestoreveal){
if (!isfirstcycle)
changeimage(curslide)
illuminateslide(curslide, opacityvalues[1])
curslide++
}
else{
isfirstcycle=0
for (i=0;i<slidestoreveal;i++)
illuminateslide(i, opacityvalues[0])
changeimage(0)
illuminateslide(0, opacityvalues[1])
curslide=1
}
}
function changeimage(slideindex){
document.getElementById(“seqslide”+slideindex).innerHTML=processimgcode(seqslides[curimgindex])
curimgindex++
if (curimgindex>=seqslides.length)
curimgindex=0
}
if (document.getElementById)
setInterval(“displayit()”,slidedelay)
//]]>
</script>[/I]

The problem is that when i save this in a content editor, the following code get created as well:

[I]<span class=”seqslidestyle” id=”seqslide0″><a href=”http://www.bmshomes.co.uk/” target=”secwindow”>
<img style=”FILTER: alpha(opacity=75); moz-opacity: 0.75″ src=”http://www.perfect.es/produccion/bni2/uploads/bms1.jpg” border=”0″ /></a></span><span class=”seqslidestyle” id=”seqslide1″><a href=”http://www.ccldesigns.net/” target=”secwindow”>
<img style=”FILTER: alpha(opacity=75); moz-opacity: 0.75″ src=”http://www.perfect.es/produccion/bni2/uploads/ccl1.jpg” border=”0″ /></a></span><span class=”seqslidestyle” id=”seqslide2″><a href=”http://www.listersgroup.co.uk” target=”secwindow”>
<img style=”FILTER: alpha(opacity=75); moz-opacity: 0.75″ src=”http://www.perfect.es/produccion/bni2/uploads/audi1.jpg” border=”0″ /></a></span> [/I]

Therefore, an extra 3 images appear for no reason, and i can’t get rid of them. Even if i try to modify the code and then save it again, another extra tier of 3 images are displayed. I have no idea why it is doing this, but am hoping someone out there has the answer to fix this.

I appreciate any help/advice people may have on this.

thanks

gsidhu

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@vwphillipsMay 08.2006 — the code has this line

document.write('<span id="seqslide'+i+'" class="seqslidestyle">'+processimgcode(seqslides[i])+'</span>'+slideseparater)





which writes the HTML Code



saves you typing and adding the required ID and event calls
Copy linkTweet thisAlerts:
@gsidhuauthorMay 08.2006 — ok,

i understand that the

document.write('<span id="seqslide'+i+'" class="seqslidestyle">'+processimgcode(seqslides[i])+'</span>'+slideseparater)



create the html code, but the additional code:



<span class="seqslidestyle" id="seqslide0"><a href="http://www.bmshomes.co.uk/" target="secwindow">

<img style="FILTER: alpha(opacity=75); moz-opacity: 0.75" src="http://www.perfect.es/produccion/bni2/uploads/bms1.jpg" border="0" /></a></span>

..

..



this code is automatically created somehow, which is not what i want, is there a part of the javascript that can remove this?
×

Success!

Help @gsidhu 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.18,
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,
)...