菜单

网站开场图片

2010年04月16日 - javascript

function main($content, $conf) {
$this->conf = $conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$this->pi_initPIflexform();

$uploadFolder = ‘uploads/tx_logo/’;
$logo = $this->pi_getFFvalue($this->cObj->data[“pi_flexform”],’logo’);
$logoImg = $logo ? $uploadFolder.$logo : ‘fileadmin/templates/images/star_logo.gif’;
$timeOut = $this->pi_getFFvalue($this->cObj->data[“pi_flexform”],’timeout’);
$timeOut = $timeOut ? $timeOut : 3;
$GLOBALS[‘TSFE’]->additionalHeaderData[‘logo’]=”<script type=’text/javascript’>
(function($){
$(document).ready(function(){
var hasView = getCookie(‘hasView’),timer = null;
if(!hasView){
setCookie(‘hasView’,true);
$(‘<div id=\”star_logo\”><div id=\”star_logo_box\”><img src=\””.$logoImg.”\” /></div></div>’).appendTo($(‘body’));
var oHeight = $(‘body’).height();
$(‘#star_logo’).height(oHeight);
$(‘#star_logo_box’).fadeIn(‘slow’,function(){
timer = setTimeout(function(){
$(‘#star_logo_box’).fadeOut(‘slow’,function(){
$(‘#star_logo’).remove();
});

},”.($timeOut*1000).”);
});
$(‘#star_logo’).click(function(){
$(this).remove();
clearTimeout(timer);
});
}

function setCookie(sName,sValue){
document.cookie = sName +’=’+ encodeURIComponent(sValue);
}
function getCookie(sName){
var sRE = ‘(?:; )?’ + sName + ‘=([^;]*);?’;
var oRE = new RegExp(sRE);
if(oRE.test(document.cookie)){
return decodeURIComponent(RegExp[‘$1’]);
}else{
return null;
}
}

});
})(jQuery);
</script>”;
}

发表评论

电子邮件地址不会被公开。 必填项已用*标注