1 つのページで複数のスライドショーを実行するのに問題があります。与えられたコードを使用して期限を迎えようとしています(これは古くなっていることがわかっています)。私の最初の問題は、同じ名前の複数の関数の使用でした。関数を他の関数に埋め込んでそれらを区別することでその問題を解決しました(例:show1()show2())。これが私がこれまでに持っているものです。複数のことがあり、JavaScriptの知識が不足している可能性があるため、現在何が問題なのかわかりません。どんな助けでもありがとう!
<!-- The following script is for the rotating images for the banner ad in right column -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -
if (document.images) {
ads = new Array(5);
ads[0] = "./images/okuma.jpg";
ads[1] = "./images/schlumberger.gif";
ads[2] = "./images/uesystems_logo.jpg";
ads[3] = "./images/brady.jpg";
ads[4] = "./images/ats.png";
}
newplace = new Array(5);
newplace[0] = "http://www.okuma.com/home.html"
newplace[1] = "http://www.slb.com/"
newplace[2] = "http://www.uesystems.com/"
newplace[3] = "http://www.bradyid.com/bradyid/cms/contentView.do/6974/Visual- Workplace.html"
newplace[4] = "http://www.advancedtech.com/"
var timer = null
var counter = 0
function banner() {
timer=setTimeout("ban()", 6000);
counter++;
if (counter >= 5)
counter = 0;
document.bannerad1.src = ads[counter];
}
function show1(){
function gothere() {
counter2 = counter;
window.open(newplace[counter2]);
}
}
// - End of JavaScript - -->
</script>
<!-- The following script is for the rotating images for the banner ad in right column(2) -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -
if (document.images) {
ads = new Array(4);
ads[0] = "./marcon/images/arms_reliability_logo.jpg";
ads[1] = "./marcon/images/brunson_logo.jpg";
ads[2] = "./marcon/images/ctc_logo.jpg";
ads[3] = "./marcon/images/descase_logo.jpg";
}
newplace = new Array(4);
newplace[0] = "http://www.globalreliability.com/home"
newplace[1] = "http://www.brunson.us"
newplace[2] = "http://www.ctconline.com/_home.aspx"
newplace[3] = "http://www.des-case.com"
var timer = null
var counter = 0
function banner() {
timer=setTimeout("banner()", 6000);
counter++;
if (counter >= 4)
counter = 0;
document.bannerad2.src = ads[counter];
}
function show2(){
function gothere() {
counter2 = counter;
window.open(newplace[counter2]);
}
}
// - End of JavaScript - -->
</script>
と
<p align="center"><font size="2"><b>Companies Supporting<br />R&M Research:</b><br /> (click logo for company info)</font></p>
<p align="center"><a href="javascript:show1()"><IMG SRC="./images/schlumberger.gif" WIDTH="180" HIGHT="200" BORDER="0" NAME="bannerad1"></a>
</p>
<br />
<hr noshade="noshade" size="0" color="#4c617e" />
<br />
<p align="center"><font size="1"><b>Thank you to the following for<br />their MARCON '12 support</b><br />(click logo for company info)</font></p>
<p align="center"><a href="javascript:show2()"><IMG SRC="./marcon/images/arms_reliability_logo.jpg" WIDTH="180" HIGHT="200" BORDER="0" NAME="bannerad2"></a>