旋转横幅,但HTML中有一个横幅

时间:2018-06-20 09:03:42

标签: javascript html

我有以下用于旋转横幅的脚本

var imgs1 = new Array("https://www.mysite.gr/wp-content/uploads/2017/03/Minetta-Slug.gif", "https://www.mysite.gr/wp-content/uploads/2017/04/728_128colors.gif", "https://www.mysite.gr/wp-content/uploads/2017/09/logoglass2.gif");
var lnks1 = new Array("http://www.minetta.gr/", "https://www.hdi.global/gr/el", "https://www.glassdrive.gr");
var alt1 = new Array("www.minetta.gr", "www.hdi.global/gr/el", "www.glassdrive.gr");
var currentA1 = 0;
var imgCt1 = 3;

function cycle1() {
  if (currentA1 == imgCt1) {
    currentA1 = 0;
  }
  var lorida1 = document.getElementById('alorida1');
  var link1 = document.getElementById('aLink1');
  lorida1.src = imgs1[currentA1]
  lorida1.alt = alt1[currentA1]
  document.getElementById('aLink1').href = lnks1[currentA1]
  currentA1++;
}
window.setInterval("cycle1()", 8400);
<a href="" http://www.minetta.gr/ "" id="aLink1" target="_top">
  <img src="https://www.insurancedaily.gr/wp-content/uploads/2017/03/Minetta-Slug.gif" id="alorida1" border="0" width="728" height="90"></a>

但是现在我想用html5横幅替换第一个图标。我该怎么办?

0 个答案:

没有答案