📄 adblockimg.tpl
字号:
<!--鍥剧墖骞垮憡--><!--Author:HH.Sun-->
{literal}<style type="text/css">
#idGlideView{/literal}{$flags}{literal}{height:{/literal}{$imghg}{literal}px;margin:10px auto;}
#idGlideView{/literal}{$flags}{literal} div{width:{/literal}{if $childCont==1}{$advwidth}{else}{$subwidth}{/if}{literal}px;height:{/literal}{$imghg}{literal}px; text-overflow: hidden;}
#idGlideView{/literal}{$flags}{literal} div a{text-overflow: hidden; width:{/literal}{if $childCont==1}{$advwidth}{else}{$subwidth}{/if}{literal}px;height:{/literal}{$ahg}{literal}px;filter: alpha(opacity=50);opacity: 0.5; background:#000; color:#fff; text-decoration:none;}
</style>{/literal}{if $loadjs}{literal}<script language="javascript" >
var Tools = {
getElemenetObj : function(ElementId)
{
return typeof(ElementId)=='string' ? document.getElementById(ElementId) : ElementId;
},
isNull : function (value)
{
return typeof(value)=='undefined'||
typeof(value)== undefined ||
value == null ||
value == '';
},
Event : function(e)
{
var oEvent = document.all ? window.event : e;
if(document.all)
{
if(oEvent.type == 'mouseout')
oEvent.relatedTarget = oEvent.toElement;
else if(oEvent.type = 'mouseover')
oEvent.relatedTarget = oEvent.fromElement;
}
return oEvent;
},
registerEventHandler : function(oElement,sEventType,fnEventHandler)
{
if(oElement.addEventListener)
oElement.addEventListener(sEventType,fnEventHandler,false)
else if(oElement.attachEvent)
oElement.attachEvent('on'+sEventType,fnEventHandler)
else
oElement['on'+sEventType] = fnEventHandler;
},
extend : function(oReturn,oSrc)
{
if(this.isNull(oSrc))
{
alert('Param Error for Tools.extend(),the param oSrc\' type:'+typeof(oSrc));
return false;
}
for(var proprety in oSrc)
{
oReturn[proprety] = oSrc[proprety];
}
return oReturn;
},
getAgent : function()
{
return (typeof document.implementation != 'undefined')&&
(typeof document.implementation.createDocument != 'undefined')&&
(HTMLDocument != 'undefined') ? 'Mozilla' :
window.ActiveXObject ? 'IE' :
navigator.userAgent.toLowerCase().indexOf('firefox')!= -1 ? 'FireFox' :
navigator.userAgent.toLowerCase().indexOf('safari') != -1 ? 'Safari' :
navigator.userAgent.toLowerCase().indexOf('opera') != -1 ? 'Opera' :
'IE';
}
};
var classes = {
create:function(){
return function(){
this.init.apply(this,arguments);
}
}
};
var imageslide = new classes.create();
imageslide.prototype = {
ShowType:Array(
1,
2,
3),
init : function(aContainer,aShowimage,aOptions,iShowType)
{
if(iShowType==this.ShowType[0])
{
var oContainer = Tools.getElemenetObj(aContainer.ContainerId);
var oSelf = this;
var len = 0;
this.SetOptions(aOptions);
this.Step = Math.abs(this.Options.Step);
this.Time = Math.abs(this.Options.Time);
this.Children = oContainer.getElementsByTagName(aShowimage.ShowimageElement);
len = this.Children.length;
this.CountChild = len;
this.ChildWidth = parseInt(aContainer.ContainerWidth/len);
this.ChildWidthMax = parseInt(aShowimage.ShowimageMaxWidth);
this.ChildWidthMin = parseInt((aContainer.ContainerWidth-this.ChildWidthMax)/(len-1));
this.Timers = null;
if(this.Options.TextElement && this.Options.TextHeight>0)
{
this.Showtext = true;
this.TextElement = oContainer.getElementsByTagName(this.Options.TextElement);
this.TextHeight = -parseInt(this.Options.TextHeight);
};
this.Each(function(oChildren,oText,i){
oChildren._target = this.ChildWidth*i;
oChildren.style.left = oChildren._target+'px';
oChildren.style.position = 'absolute';
Tools.registerEventHandler(oChildren,'mouseover',function(){oSelf.Set.call(oSelf,i);});
if(oText)
{
oText._target = this.TextHeight;
oText.style.bottom = oText._target+'px';
oText.style.position = 'absolute';
}
});
oContainer.style.width = aContainer.ContainerWidth+'px';
oContainer.style.overflow = 'hidden';
oContainer.style.position = "relative";
Tools.registerEventHandler(oContainer,'mouseout',function(e)
{
var o = Tools.Event(e).relatedTarget;
if(oContainer.contains ?
!oContainer.contains(o):
oContainer != o && !(oContainer.compareDocumentPosition(o) & 16))
oSelf.Set.call(oSelf,-1);
});
}
else if(iShowType == this.ShowType[1])
{
}
else if(iShowType == this.ShowType[3])
{};
},
SetOptions : function(aOptions)
{
this.Options = {
Step : 20,
Time : 20,
TextElement : '',
TextHeight : 0
};
Tools.extend(this.Options,aOptions);
},
Set : function (index)
{
if(index<0)
{
this.Each(function(oChildren,oText,i)
{
oChildren._target = this.ChildWidth*i;
if(oText)
{
oText._target = this.TextHeight;
}
});
}
else
{
this.Each(function(oChildren,oText,i){
oChildren._target = (i<=index)? this.ChildWidthMin*i : this.ChildWidthMin*(i-1)+this.ChildWidthMax;
oChildren._target = isNaN(oChildren._target)? 0 : oChildren._target;
if(oText)
{
oText._target = (i==index) ? 0 : this.TextHeight;
}
});
}
this.Move();
},
Move : function()
{
clearTimeout(this.Timers);
var bFinish = true;
this.Each(function(oChildren,oText,i)
{
var iNow = parseInt(oChildren.style.left);
var iStep = this.GetStep(oChildren._target,iNow);
if(iStep != 0)
{
bFinish = false;
oChildren.style.left = (iNow+iStep)+'px';
}
if(oText)
{
iNow = parseInt(oText.style.bottom),iStep=this.GetStep(oText._target,iNow);
if(iStep != 0)
{
bFinish = false;
oText.style.bottom = (iNow+iStep)+'px';
}
}
});
if(!bFinish){
var oSelf = this;
this.Timers = setTimeout(function(){oSelf.Move();},this.Time);
};
},
GetStep : function(iTarget,iNow)
{
var iStep = (iTarget - iNow)/this.Step;
if(iStep==0)return 0;
if(Math.abs(iStep)<1)return(iStep>0? 1 : -1);
return iStep;
},
Each : function(fnMethod)
{
for(var i=0; i < this.CountChild; i++)
{
if(typeof(this.Children[i])!="undefined"&&this.Children[i]!=null)
fnMethod.call(this,this.Children[i],(this.Showtext ? this.TextElement[i] : null),i);
}
}
};
</script>{/literal}{/if}
<div name='advimage' id='idGlideView{$flags}'>
{foreach from=$imagse item=imageshow}
<div style="background:url('{$disurl}{$imageshow.src_url}')"><a href="{$imageshow.adv_url}">{$imageshow.src_txt} </a> </div>
{/foreach}
</div>
{literal}
<script>
acontidGlideView{/literal}{$flags}{literal} = Array();
acontidGlideView{/literal}{$flags}{literal}.ContainerId = 'idGlideView{/literal}{$flags}{literal}';
acontidGlideView{/literal}{$flags}{literal}.ContainerWidth = {/literal}{$advwidth}{literal};
showidGlideView{/literal}{$flags}{literal} = Array();
showidGlideView{/literal}{$flags}{literal}.ShowimageElement = 'div';
showidGlideView{/literal}{$flags}{literal}.ShowimageMaxWidth = {/literal}{$subwidth}{literal};
var idGlideView{/literal}{$flags}{literal} = new imageslide(acontidGlideView{/literal}{$flags}{literal}, showidGlideView{/literal}{$flags}{literal}, { TextElement: "a", TextHeight: {/literal}{$ahg}{literal} },1);
</script>
{/literal}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -