第一个对联广告,,
第二对联广告
var vbWidth = 89;
var vbHeight = 454;
var vbSrc1 = 'http://topic.csdn.net/ui/images/logo_csdn.gif;
var vbSrc2 = 'http://topic.csdn.net/ui/images/logo_csdn.gif';
var vbUrl1 = '#;
var vbUrl2 = '#';
var delta = 0.15
var collection;
function floaters() {
this.items = [];
var intervalId;
this.addItem = function(id, x, y, content)
{
document.write('
' + content + '
');
var newItem = {};
newItem.object = document.getElementById(id);
newItem.x = x;
newItem.y = y;
this.items[this.items.length] = newItem;
}
this.play = function()
{
collection = this.items
intervalId = setInterval('play()', 10);
}
this.close = function()
{
clearInterval(intervalId);
for (var i = 0; i < this.items.length; i++)
{
this.items[i].object.style.display = 'none';
}
}
}
function play()
{
if (screen.width <= 800 || document.documentElement.clientWidth <= 800)
{
for (var i = 0; i < collection.length; i++)
{
collection[i].object.style.display = 'none';
}
return;
}
for (var i = 0; i < collection.length; i++)
{
var followObj = collection[i].object;
var followObj_x = (typeof(collection[i].x) == 'string' ? eval(collection[i].x) : collection[i].x);
var followObj_y = (typeof(collection[i].y) == 'string' ? eval(collection[i].y) : collection[i].y);
followObj.style.left = document.documentElement.scrollLeft + followObj_x;
/*
if (followObj.offsetLeft != (document.documentElement.scrollLeft + followObj_x)) {
var dx = (document.documentElement.scrollLeft + followObj_x - followObj.offsetLeft) * delta;
dx = (dx > 0 ? 1 : -1) * Math.ceil(Math.abs(dx));
followObj.style.left = followObj.offsetLeft + dx;
}
*/
if (followObj.offsetTop != (document.documentElement.scrollTop + followObj_y)) {
var dy = (document.documentElement.scrollTop + followObj_y - followObj.offsetTop) * delta;
dy = (dy > 0 ? 1 : -1) * Math.ceil(Math.abs(dy));
followObj.style.top = followObj.offsetTop + dy;
}
followObj.style.display = '';
}
}
function closeFoloaters()
{
theFloaters.close();
}
var theFloaters = new floaters();
theFloaters.addItem('vb1', 'document.documentElement.clientWidth-90', 88, '
');
theFloaters.addItem('vb2', 0, 88, '
');
theFloaters.play();
阅读(750) | 评论(0) | 转发(0) |