仿阿里巴巴字母轮换的JS出现错误document.getElementById(...)' 为空或不是对象
<scripttype="text/JavaScript">(function(){vartimer;varpopIndex=-1;varpopCtrl=document...
<script type="text/JavaScript">
(function() {
var timer;
var popIndex = -1;
var popCtrl = document.getElementById('popCtrl').getElementsByTagName('a');
for (var i = 1; i < popCtrl.length; i++) {
popCtrl[i].onmouseover = function(i) {
return function() {
timer = window.setTimeout(function ()
{
this.className = 'titleon';
if (popIndex != -1 && popIndex != i) {
popCtrl[popIndex].className = 'title';
document.getElementById('pop' + popIndex).style.display = 'none';
}
showPop(i);
popIndex = i;
}, 250);
}
} (i)
popCtrl[i].onmouseout = function(i) {
return function(evt) {
clearTimeout(timer);
var popWrap = document.getElementById('pop' + i);
if (/Firefox/.test(window.navigator.userAgent)) { 展开
(function() {
var timer;
var popIndex = -1;
var popCtrl = document.getElementById('popCtrl').getElementsByTagName('a');
for (var i = 1; i < popCtrl.length; i++) {
popCtrl[i].onmouseover = function(i) {
return function() {
timer = window.setTimeout(function ()
{
this.className = 'titleon';
if (popIndex != -1 && popIndex != i) {
popCtrl[popIndex].className = 'title';
document.getElementById('pop' + popIndex).style.display = 'none';
}
showPop(i);
popIndex = i;
}, 250);
}
} (i)
popCtrl[i].onmouseout = function(i) {
return function(evt) {
clearTimeout(timer);
var popWrap = document.getElementById('pop' + i);
if (/Firefox/.test(window.navigator.userAgent)) { 展开
1个回答
2010-11-09
展开全部
代码不完整啊
或者试试这个图片切换
有12345数字一起切换
鼠标点一下数字会变换到另一张图片,不点就会自动换
里面有教程和源码
或者试试这个图片切换
有12345数字一起切换
鼠标点一下数字会变换到另一张图片,不点就会自动换
里面有教程和源码
参考资料: http://www.blueidea.com/common/shoutbox/redir.asp?9=p&id=10895
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询