ie6 ScrollPic未定义

图片滚动代码,ie6下运行后出现ScrollPic未定义。

 

可能原因:ScrollPic.js文件的编码和调用这个文件的文件编码不一致所致

 

解决方法:将两个文件编码统一。

 

例:pic.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title></title>

<script type="text/javascript" src="ScrollPic.js"></script>

</head>

<body>

...

</body>

</html>

 

 

ScrollPic.js

var sina={$:function(objName){if(document.getElementByIdx_x){return eval_r('document.getElementByIdx_x("'+objName+'")')}else{return eval_r('document.all.'+objName)}},isIE:navigator.appVersion.indexOf("MSIE")!=-1?true:false,addEvent:function(l,i,I){if(l.attachEvent){l.attachEvent("on"+i,I)}else{l.addEventListener(i,I,false)}},delEvent:function(l,i,I){if(l.detachEvent){l.detachEvent("on"+i,I)}else{l.removeEventListener(i,I,false)}},readCookie:function(O){var o="",l=O+"=";if(document.cookie.length>0){var i=document.cookie.indexOf(l);if(i!=-1){i+=l.length;var I=document.cookie.indexOf(";",i);if(I==-1)I=document.cookie.length;o=unescape(document.cookie.substring(i,I))}};return o},writeCookie:function(i,l,o,c){var O="",I="";if(o!=null){O=new Date((new Date).getTime()+o*3600000);O="; expires="+O.toGMTString()};if(c!=null){I=";domain="+c};document.cookie=i+"="+escape(l)+O+I},readStyle:function(I,l){if(I.style[l]){return I.style[l]}else if(I.currentStyle){return I.currentStyle[l]}else if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(I,null);return i.getPropertyValue(l)}else{return null}}};

//滚动图片构造函数
//
UI&UE Dept. mengjia
//
080623
function ScrollPic(scrollContId,arrLeftId,arrRightId,dotListId){..}

 

 

将ScrollPic.js文件在DW或者其它软件打开,菜单:【修改】→【页面属性】,将【文档编码】改为UTF-8即可

ie6 ScrollPic未定义

 

http://blog.sina.com.cn/s/blog_454fbf740100kbfr.html

你可能感兴趣的:(scroll)