묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
롤오버 에러메세지 질문입니다..
2005.02.09 05:42
포토샾 이미지레디에서 만든 롤오버 문제입니다.
실행은 되는데 브라우저하단에 노란느낌표가 뜨면서 error on page 라고 계속뜨네요
메세지 더블클릭했을때 보여지는 에러메세지 내용은
Error : document [...] is null or not an object
code : 0
소스는
<html>
<head>
<title>제목</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script type="text/javascript">
<!--
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1]; <---- 이부분에서 뜹니다 -_-;
}
}
}
var preloadFlag = false;
function preloadImages() {
if (document.images) {
cp2_by____02_cp2_by____05_over = newImage("../images/cp2_by-성원_02-cp2_by-성원_.gif");
cp2_by____02_cp2_by____06_over = newImage("../images/cp2_by-성원_02-cp2_by-성-05.gif");
cp2_by____02_cp2_by____07_over = newImage("../images/cp2_by-성원_02-cp2_by-성-06.gif");
cp2_by____02_cp2_by____08_over = newImage("../images/cp2_by-성원_02-cp2_by-성-07.gif");
cp2_by____02_cp2_by____09_over = newImage("../images/cp2_by-성원_02-cp2_by-성-08.gif");
cp2_by____02_cp2_by____10_over = newImage("../images/cp2_by-성원_02-cp2_by-성-09.gif");
cp2_by____02_cp2_by____04_over = newImage("../images/cp2_by-성원_02-cp2_by-성-10.gif");
cp2_by____03_over = newImage("../images/cp2_by-성원_03-over.gif");
cp2_by____04_over = newImage("../images/cp2_by-성원_04-over.gif");
cp2_by____05_over = newImage("../images/cp2_by-성원_05-over.gif");
cp2_by____06_over = newImage("../images/cp2_by-성원_06-over.gif");
cp2_by____06_cp2_by____07_over = newImage("../images/cp2_by-성원_06-cp2_by-성원_.gif");
cp2_by____07_over = newImage("../images/cp2_by-성원_07-over.gif");
cp2_by____08_over = newImage("../images/cp2_by-성원_08-over.gif");
cp2_by____08_cp2_by____09_over = newImage("../images/cp2_by-성원_08-cp2_by-성원_.gif");
cp2_by____09_over = newImage("../images/cp2_by-성원_09-over.gif");
cp2_by____10_over = newImage("../images/cp2_by-성원_10-over.gif");
cp2_by____12_cp2_by____05_over = newImage("../images/cp2_by-성원_12-cp2_by-성원_.gif");
cp2_by____12_cp2_by____06_over = newImage("../images/cp2_by-성원_12-cp2_by-성-32.gif");
cp2_by____12_cp2_by____07_over = newImage("../images/cp2_by-성원_12-cp2_by-성-33.gif");
cp2_by____12_cp2_by____08_over = newImage("../images/cp2_by-성원_12-cp2_by-성-34.gif");
cp2_by____12_cp2_by____09_over = newImage("../images/cp2_by-성원_12-cp2_by-성-35.gif");
cp2_by____12_cp2_by____10_over = newImage("../images/cp2_by-성원_12-cp2_by-성-36.gif");
cp2_by____12_cp2_by____03_over = newImage("../images/cp2_by-성원_12-cp2_by-성-37.gif");
cp2_by____12_cp2_by____04_over = newImage("../images/cp2_by-성원_12-cp2_by-성-38.gif");
preloadFlag = true;
}
}
// -->
</script>
스크립트 잘아시는분은 좀 부탁드릴깨요..
실행은 되는데 브라우저하단에 노란느낌표가 뜨면서 error on page 라고 계속뜨네요
메세지 더블클릭했을때 보여지는 에러메세지 내용은
Error : document [...] is null or not an object
code : 0
소스는
<html>
<head>
<title>제목</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script type="text/javascript">
<!--
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1]; <---- 이부분에서 뜹니다 -_-;
}
}
}
var preloadFlag = false;
function preloadImages() {
if (document.images) {
cp2_by____02_cp2_by____05_over = newImage("../images/cp2_by-성원_02-cp2_by-성원_.gif");
cp2_by____02_cp2_by____06_over = newImage("../images/cp2_by-성원_02-cp2_by-성-05.gif");
cp2_by____02_cp2_by____07_over = newImage("../images/cp2_by-성원_02-cp2_by-성-06.gif");
cp2_by____02_cp2_by____08_over = newImage("../images/cp2_by-성원_02-cp2_by-성-07.gif");
cp2_by____02_cp2_by____09_over = newImage("../images/cp2_by-성원_02-cp2_by-성-08.gif");
cp2_by____02_cp2_by____10_over = newImage("../images/cp2_by-성원_02-cp2_by-성-09.gif");
cp2_by____02_cp2_by____04_over = newImage("../images/cp2_by-성원_02-cp2_by-성-10.gif");
cp2_by____03_over = newImage("../images/cp2_by-성원_03-over.gif");
cp2_by____04_over = newImage("../images/cp2_by-성원_04-over.gif");
cp2_by____05_over = newImage("../images/cp2_by-성원_05-over.gif");
cp2_by____06_over = newImage("../images/cp2_by-성원_06-over.gif");
cp2_by____06_cp2_by____07_over = newImage("../images/cp2_by-성원_06-cp2_by-성원_.gif");
cp2_by____07_over = newImage("../images/cp2_by-성원_07-over.gif");
cp2_by____08_over = newImage("../images/cp2_by-성원_08-over.gif");
cp2_by____08_cp2_by____09_over = newImage("../images/cp2_by-성원_08-cp2_by-성원_.gif");
cp2_by____09_over = newImage("../images/cp2_by-성원_09-over.gif");
cp2_by____10_over = newImage("../images/cp2_by-성원_10-over.gif");
cp2_by____12_cp2_by____05_over = newImage("../images/cp2_by-성원_12-cp2_by-성원_.gif");
cp2_by____12_cp2_by____06_over = newImage("../images/cp2_by-성원_12-cp2_by-성-32.gif");
cp2_by____12_cp2_by____07_over = newImage("../images/cp2_by-성원_12-cp2_by-성-33.gif");
cp2_by____12_cp2_by____08_over = newImage("../images/cp2_by-성원_12-cp2_by-성-34.gif");
cp2_by____12_cp2_by____09_over = newImage("../images/cp2_by-성원_12-cp2_by-성-35.gif");
cp2_by____12_cp2_by____10_over = newImage("../images/cp2_by-성원_12-cp2_by-성-36.gif");
cp2_by____12_cp2_by____03_over = newImage("../images/cp2_by-성원_12-cp2_by-성-37.gif");
cp2_by____12_cp2_by____04_over = newImage("../images/cp2_by-성원_12-cp2_by-성-38.gif");
preloadFlag = true;
}
}
// -->
</script>
스크립트 잘아시는분은 좀 부탁드릴깨요..
이미지레디에서는 어떻게 처리하는지 모르겟으나, 이미지를 포토샵에서 작업할 때 두개를 만들었다고 가정합시다...
1. 그냥 보이는 상태의 이미지: aaaa.jpg
2. 마우스오버 상태에서 보이는 이미지: aaab.jpg
이럴 경우에
<script language="javascript">
function roll01on(){
document.image0.src=('aaab.jpg');return true
}
function foll01off(){
document.image0.src=('aaaa.jpg');return true
}
</script>
<img src="aaaa.jpg" name="image0" onMouseOver="roll01on()" onMouseOut="roll01off()">
주의하실점은 <img name="image0">에서 image0와 document.image0.src에서 image0는 일치하여야 합니다. 그 이름이 menurollover_image_aboutus1이 되건 아니면 그냥 단순하게 nzeoimage001이 되건 이름만 일치하면 에러없이 작동합니다. 물론, 함수이름도 일치하여야 합니다...
수많은 롤오버 소스를 많이 보아왔지만, 저는 주로 이소스를 사용합니다. 물론, 다른 소스들도 장단점이 다 있겠지만, 이 소스만큼 간결명료한 소스를 못봤습니다...