<html>
<head>
<title>롤링배너</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
span img{ border:1px solid red; margin:0px 0px 0px 0px; padding:0px;}
div{margin:0px; padding:0px;}
</style>
</head>
<body>
<div align="center" style="float:left"><a style="cursor: pointer" onClick="width_class.fall=false;width_class.fast=true;">이전</a></div>
<div style="float: left; overflow: hidden; width:186px; height:82px; border:1px solid red;" />
<div id="parent_rolltable" name="parent_rolltable" style="overflow: hidden;" onMouseOver="width_class.stop();" onMouseOut="width_class.inaction(width_class.temp);" />
<nobr id="rolltable" name="rolltable" style="position: relative;"><span><a href="sub/sub5_4.asp" target="_self"><img src="http://www.ywtour.com/media/GLI/gal-2541-5245.jpg" width="186" height="80" border="0" alt="그림1"></a></span><span><a href="sub/sub5_3.asp" target="_self"><img src="http://www.ywtour.com/media/GLI/gal-2542-5246.jpg" width="186" height="80" border="0" alt="그림2"></a></span></nobr>
</div>
</div>
<div align="center" style="float:left"><a style="cursor: pointer" onClick="width_class.fall=true;width_class.fast=true;">다음</a></div>
<script language="Javascript">
var roll_Class = function() {
this.initialize.apply(this, arguments);
}
roll_Class.prototype = {
initialize: function() {
this.className = arguments[0] ? arguments[0] : null;
this.foundit(arguments[1], '', false);
this.contents = new Array('0');
this.contents_delay = null;
this.nowdelay = null;
this.foundit(this.roll.childNodes, this.foundvalue, function(rt, that) {
if (that.constrain_size !== null) that.foundit(rt.childNodes, 'IMG', function(rt, that) { rt.style[(this.moving != 'left' ? 'width' : 'height')] = that.constrain_size; });
that.contents_delay = that.contents[that.contents.length] = that.contents_delay + -rt[(that.moving == 'left' ? 'offsetWidth' : 'offsetHeight')];
});
{
this.rollHeight = this.proll.style[(this.moving == 'left' ? 'width' : 'height')] = Math.abs(this.contents[this.contents.length - 1]);
this.roll.appendChild(this.roll.cloneNode(true));
}
;
}
,
foundit: function(tg, n) {
var temp = new Array();
for (var v in tg)
switch (typeof arguments[2]) {
case 'object': if (arguments[2].initialize(tg[v], n, this) == true) return;
else break;
case 'function': if (tg[v].nodeName == n) arguments[2](tg[v], this);
break;
case 'boolean': this[v] = tg[v];
break;
default: if (tg[v].nodeName == n) return tg[v];
}
return temp;
}
,
inaction: function(time) {
this.roll.style[this.moving] = time = time < 0 ? (this.fall == false && time <= -this.rollHeight ? 0 : time) : -this.rollHeight, null;
this.foundit(this.contents, time, { initialize: function(rt, vrt, that) { if (Math.abs(rt - vrt) < (that.fast == false ? that.tick : that.ftick)) { that.roll.style[that.moving] = rt; that.nowdelay = that.fast == true ? that.lengthen : that.delay; that.fast = false; return true; } else that.nowdelay = that.lengthen; } });
{
var ticks = this.fast == true ? this.ftick : this.tick;
}
this.control = setTimeout(this.className + ".inaction(" + (parseInt(this.roll.style[this.moving]) + (this.fall == true ? ticks : -ticks)) + ");", this.nowdelay);
}
,
stop: function() {
this.temp = parseInt(this.roll.style[this.moving]);
clearTimeout(this.control);
}
}
;
{
var roll_init = new Array();
roll_init.constrain_size = null; // [default]
roll_init.tick = 100; // 움직이는 속도 1~100
roll_init.ftick = 1; //
roll_init.lengthen =10; // 움직일때 부드러움
roll_init.delay = 1000; // 머무르는 시간
roll_init.fall = true;
roll_init.fast = false;
roll_init.foundvalue = 'SPAN'; // Nobr
roll_init.moving = 'left'; // 무빙시작위치
roll_init.roll = document.getElementById('rolltable'); // roll
roll_init.proll = document.getElementById('parent_rolltable'); // proll
}
;
{
var width_class = new roll_Class('width_class', roll_init);
width_class.inaction();
}
;
</script>
</body>
</html>