묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
이 소스가 제로보드에서 onLoad 시에 동작을 안해여!~~~
2002.04.07 21:29
<script language="javascript">
/*
This script is (c) 2000 Ivanopulo http://www.damn.to
Please leave this message intact if you use the script.
*/
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements()
{
var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
if ( bNetscape4plus ) {
//yButtonFrom = document["divLinkButton"].top;
//yButtonTo = top.pageYOffset + top.innerHeight - 55;
yMenuFrom = document["divMenu"].top;
yMenuTo = top.pageYOffset + 0;
}
else if ( bExplorer4plus ) {
//yButtonFrom = parseInt (divLinkButton.style.top, 10);
//yButtonTo = document.body.scrollTop + document.body.clientHeight - 55;
yMenuFrom = parseInt (divMenu.style.top, 10);
yMenuTo = document.body.scrollTop + document.body.clientHeight - 95;
}
timeoutNextCheck = 50;
if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
setTimeout ("CheckUIElements()", timeoutNextCheck);
return;
}
if ( yButtonFrom != yButtonTo ) {
yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
if ( yButtonTo < yButtonFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divLinkButton"].top += yOffset;
else if ( bExplorer4plus )
divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
if ( yMenuFrom != yMenuTo ) {
yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
if ( yMenuTo < yMenuFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divMenu"].top += yOffset;
else if ( bExplorer4plus )
divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
setTimeout ("CheckUIElements()", timeoutNextCheck);
}
function start()
{
var y;
// we're not gonna be loaded in frames
//if ( top.frames.length )
// top.location.href = self.location.href;
// setting initial UI elements positions
if ( bNetscape4plus ) {
document["divMenu"].top = top.pageYOffset + 0;
document["divMenu"].visibility = "visible";
//document["divLinkButton"].top = top.pageYOffset + top.innerHeight - 55;
//document["divLinkButton"].visibility = "visible";
}
else if ( bExplorer4plus ) {
divMenu.style.top = document.body.scrollTop + 0;
divMenu.style.visibility = "visible";
//divLinkButton.style.top = document.body.scrollTop + document.body.clientHeight - 55;
//divLinkButton.style.visibility = "visible";
}
// initializing UI update timer
CheckUIElements();
//if ( bExplorer4plus )
// setTimeout ( "FlashTitleStepIt(255)", 10 );
return true;
}
function funcSwapImage(imageName, bHilite) {
// DUMB Netscape doesn't see img names if they're inside a <div which has an id
// if they're just in <div></div> - it's okay, but that's not the case :
// Workaround (using layers) was provided by Kostya. Tnx man :)
if ( bExplorer4plus ) {
document.images[imageName].src = "images/" + imageName + (bHilite == 1 ? "_hi.gif" : "_lo.gif");
}
else if ( bNetscape4plus ) {
document.layers["divMenu"].document.images[imageName].src = "images/" + imageName + (bHilite == 1 ? "_hi.gif" : "_lo.gif");
}
return false;
}
</script>
<body onLoad="start();">
<div id="divMenu" style="width:182px; height:95px; position:absolute; left:0px; z-index:1;">
<IMG src="http://www.animeclub.net/tomato/images/copyright.gif" width="182" height="95" border=0>
</div>
</body>
이게 일반 php파일이나 htm에서는 잘 동작하는데 제로보드에 header나 footer에 들어가면 onLoad 만동작을 안합니다. onmouseover,onmouseout,onmouseclick 등은 잘되는데 왜 그런지 모르겠어요
고수님들 답변좀 부탁드려요~ T_T
/*
This script is (c) 2000 Ivanopulo http://www.damn.to
Please leave this message intact if you use the script.
*/
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements()
{
var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
if ( bNetscape4plus ) {
//yButtonFrom = document["divLinkButton"].top;
//yButtonTo = top.pageYOffset + top.innerHeight - 55;
yMenuFrom = document["divMenu"].top;
yMenuTo = top.pageYOffset + 0;
}
else if ( bExplorer4plus ) {
//yButtonFrom = parseInt (divLinkButton.style.top, 10);
//yButtonTo = document.body.scrollTop + document.body.clientHeight - 55;
yMenuFrom = parseInt (divMenu.style.top, 10);
yMenuTo = document.body.scrollTop + document.body.clientHeight - 95;
}
timeoutNextCheck = 50;
if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
setTimeout ("CheckUIElements()", timeoutNextCheck);
return;
}
if ( yButtonFrom != yButtonTo ) {
yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
if ( yButtonTo < yButtonFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divLinkButton"].top += yOffset;
else if ( bExplorer4plus )
divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
if ( yMenuFrom != yMenuTo ) {
yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
if ( yMenuTo < yMenuFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divMenu"].top += yOffset;
else if ( bExplorer4plus )
divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
setTimeout ("CheckUIElements()", timeoutNextCheck);
}
function start()
{
var y;
// we're not gonna be loaded in frames
//if ( top.frames.length )
// top.location.href = self.location.href;
// setting initial UI elements positions
if ( bNetscape4plus ) {
document["divMenu"].top = top.pageYOffset + 0;
document["divMenu"].visibility = "visible";
//document["divLinkButton"].top = top.pageYOffset + top.innerHeight - 55;
//document["divLinkButton"].visibility = "visible";
}
else if ( bExplorer4plus ) {
divMenu.style.top = document.body.scrollTop + 0;
divMenu.style.visibility = "visible";
//divLinkButton.style.top = document.body.scrollTop + document.body.clientHeight - 55;
//divLinkButton.style.visibility = "visible";
}
// initializing UI update timer
CheckUIElements();
//if ( bExplorer4plus )
// setTimeout ( "FlashTitleStepIt(255)", 10 );
return true;
}
function funcSwapImage(imageName, bHilite) {
// DUMB Netscape doesn't see img names if they're inside a <div which has an id
// if they're just in <div></div> - it's okay, but that's not the case :
// Workaround (using layers) was provided by Kostya. Tnx man :)
if ( bExplorer4plus ) {
document.images[imageName].src = "images/" + imageName + (bHilite == 1 ? "_hi.gif" : "_lo.gif");
}
else if ( bNetscape4plus ) {
document.layers["divMenu"].document.images[imageName].src = "images/" + imageName + (bHilite == 1 ? "_hi.gif" : "_lo.gif");
}
return false;
}
</script>
<body onLoad="start();">
<div id="divMenu" style="width:182px; height:95px; position:absolute; left:0px; z-index:1;">
<IMG src="http://www.animeclub.net/tomato/images/copyright.gif" width="182" height="95" border=0>
</div>
</body>
이게 일반 php파일이나 htm에서는 잘 동작하는데 제로보드에 header나 footer에 들어가면 onLoad 만동작을 안합니다. onmouseover,onmouseout,onmouseclick 등은 잘되는데 왜 그런지 모르겠어요
고수님들 답변좀 부탁드려요~ T_T
<div id="divMenu" style="width:182px; height:95px; position:absolute; left:0px; z-index:1;">
<IMG src="http://www.animeclub.net/tomato/images/copyright.gif" width="182" height="95" border=0>
</div>
<script language="javascript">
/*
This script is (c) 2000 Ivanopulo http://www.damn.to
Please leave this message intact if you use the script.
*/
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements()
{
var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
if ( bNetscape4plus ) {
//yButtonFrom = document["divLinkButton"].top;
//yButtonTo = top.pageYOffset + top.innerHeight - 55;
yMenuFrom = document["divMenu"].top;
yMenuTo = top.pageYOffset + 0;
}
else if ( bExplorer4plus ) {
//yButtonFrom = parseInt (divLinkButton.style.top, 10);
//yButtonTo = document.body.scrollTop + document.body.clientHeight - 55;
yMenuFrom = parseInt (divMenu.style.top, 10);
yMenuTo = document.body.scrollTop + document.body.clientHeight - 95;
}
timeoutNextCheck = 50;
if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
setTimeout ("CheckUIElements()", timeoutNextCheck);
return;
}
if ( yButtonFrom != yButtonTo ) {
yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
if ( yButtonTo < yButtonFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divLinkButton"].top += yOffset;
else if ( bExplorer4plus )
divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
if ( yMenuFrom != yMenuTo ) {
yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
if ( yMenuTo < yMenuFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divMenu"].top += yOffset;
else if ( bExplorer4plus )
divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
setTimeout ("CheckUIElements()", timeoutNextCheck);
}
function start()
{
var y;
// we're not gonna be loaded in frames
//if ( top.frames.length )
// top.location.href = self.location.href;
// setting initial UI elements positions
if ( bNetscape4plus ) {
document["divMenu"].top = top.pageYOffset + 0;
document["divMenu"].visibility = "visible";
//document["divLinkButton"].top = top.pageYOffset + top.innerHeight - 55;
//document["divLinkButton"].visibility = "visible";
}
else if ( bExplorer4plus ) {
divMenu.style.top = document.body.scrollTop + 0;
divMenu.style.visibility = "visible";
//divLinkButton.style.top = document.body.scrollTop + document.body.clientHeight - 55;
//divLinkButton.style.visibility = "visible";
}
// initializing UI update timer
CheckUIElements();
//if ( bExplorer4plus )
// setTimeout ( "FlashTitleStepIt(255)", 10 );
return true;
}
function funcSwapImage(imageName, bHilite) {
// DUMB Netscape doesn't see img names if they're inside a <div which has an id
// if they're just in <div></div> - it's okay, but that's not the case :\
// Workaround (using layers) was provided by Kostya. Tnx man :)
if ( bExplorer4plus ) {
document.images[imageName].src = "images/" + imageName + (bHilite == 1 ? "_hi.gif" : "_lo.gif");
}
else if ( bNetscape4plus ) {
document.layers["divMenu"].document.images[imageName].src = "images/" + imageName + (bHilite == 1 ? "_hi.gif" : "_lo.gif");
}
return false;
}
window.onLoad=start();
</script>