您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程
ecshop首页轮播广告图片播放器怎么用js播放器替换
陈茗卓2023-11-30 21:18:44ecshop商城教程已有人查阅
导读1、首页主广告管理-》自定义,粘下以下代码;寻找$smarty->display('index.dwt', $cache_id);下面加:
1、首页主广告管理-》自定义,粘下以下代码:
寻找$smarty->display('index.dwt', $cache_id);下面加:
<script type="text/javascript">
var glide =new function(){
function $id(id){return document.getElementByIdx_x(id);};
this.layerGlide=function(auto,oEventCont,oSlider,sSingleSize,second,fSpeed,point){
var oSubLi = $id(oEventCont).getElementsByTagName_r('li');
var interval,timeout,oslideRange;
var time=1;
var speed = fSpeed
var sum = oSubLi.length;
var a=0;
var delay=second * 2000;
var setValLeft=function(s){
return function(){
oslideRange = Math.abs(parseInt($id(oSlider).style[point]));
$id(oSlider).style[point] =-Math.floor(oslideRange+(parseInt(s*sSingleSize) - oslideRange)*speed) +'px';
if(oslideRange==[(sSingleSize * s)]){
clearInterval(interval);
a=s;
}
}
};
var setValRight=function(s){
return function(){
oslideRange = Math.abs(parseInt($id(oSlider).style[point]));
$id(oSlider).style[point] =-Math.ceil(oslideRange+(parseInt(s*sSingleSize) - oslideRange)*speed) +'px';
if(oslideRange==[(sSingleSize * s)]){
clearInterval(interval);
a=s;
}
}
}
function autoGlide(){
for(var c=0;c<sum;c++){oSubLi[c].className='';};
clearTimeout(interval);
if(a==(parseInt(sum)-1)){
for(var c=0;c<sum;c++){oSubLi[c].className='';};
a=0;
oSubLi[a].className="active";
interval = setInterval(setValLeft(a),time);
timeout = setTimeout(autoGlide,delay);
}else{
a++;
oSubLi[a].className="active";
interval = setInterval(setValRight(a),time);
timeout = setTimeout(autoGlide,delay);
}
}
if(auto){timeout = setTimeout(autoGlide,delay);};
for(var i=0;i<sum;i++){
oSubLi.onmouseover = (function(i){
return function(){
for(var c=0;c<sum;c++){oSubLi[c].className='';};
clearTimeout(timeout);
clearInterval(interval);
oSubLi.className="active";
if(Math.abs(parseInt($id(oSlider).style[point]))>[(sSingleSize * i)]){
interval = setInterval(setValLeft(i),time);
this.onmouseout=function(){if(auto){timeout = setTimeout(autoGlide,delay);};};
}else if(Math.abs(parseInt($id(oSlider).style[point]))<[(sSingleSize * i)]){
interval = setInterval(setValRight(i),time);
this.onmouseout=function(){if(auto){timeout = setTimeout(autoGlide,delay);};};
}
}
})(i)
}
}
}
glide.layerGlide(true,'icon_num','show_pic',534,2,0.1,'left');
</script>
<!-- 向右效果 -->
2、index.php:寻找$smarty->display('index.dwt', $cache_id);下面加:
function get_flash_xml()
{
$flashdb = array();
if (file_exists(ROOT_PATH . DATA_DIR . '/flash_data.xml'))
{
// 兼容v2.7.0及以前版本
if (!preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"\ssort="([^"]*)"/', file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $t, PREG_SET_ORDER))
{
preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"/', file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $t, PREG_SET_ORDER);
}
if (!empty($t))
{
foreach ($t as $key => $val)
{
$val[4] = isset($val[4]) ? $val[4] : 0;
$flashdb[] = array('src'=>$val[1],'url'=>$val[2],'text'=>$val[3],'sort'=>$val[4]);
}
}
}
return $flashdb;
}
3、寻找
$smarty->assign('auction_list',index_get_auction());// 拍卖活动,下面加上:
$smarty->assign('playerdb', get_flash_xml()); // FLASHJS广告
4、index_ad.lbi:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- {if $index_ad eq 'sys'} -->
<script type="text/javascript">
var swf_width=534;
var swf_height=200;
</script>
<script type="text/javascript" src="data/flashdata/{$flash_theme}/cycle_image.js"></script>
<!-- {elseif $index_ad eq 'cus'} -->
<!-- {if $ad.ad_type eq 0} -->
<a href="{$ad.url}" target="_blank"><img src="{$ad.content}" width="534" height="200" border="0"></a>
<!-- {elseif $ad.ad_type eq 1} -->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="534" height="200">
<param name="movie" value="{$ad.content}" />
<param name="quality" value="high" />
<embed src="{$ad.content}" quality="high" pluginspage="http://www.ebingou.cn/go/getflashplayer" type="application/x-shockwave-flash" width="534" height="200"></embed>
</object>
<!-- {elseif $ad.ad_type eq 2} -->
<div id="picBox">
<ul id="show_pic" style="left:0;">
{foreach from=$playerdb item=item key=key}
<li><a href="{$item.url}" target="_blank"><img src="{$item.src}" alt="{$item.text}" /></a></li>
{/foreach}
</ul>
<ul id="icon_num">
{foreach from=$playerdb item=item name=picsitem key=key}
<li <!--{if $smarty.foreach.picsitem.iteration eq 1}-->class="active" <!--{/if}-->>{$item.text}</li>
{/foreach}
</ul>
</div>
{$ad.content}
<!-- {elseif $ad.ad_type eq 3} -->
<a href="{$ad.url}" target="_blank">{$ad.content}</a>
<!-- {/if} -->
<!-- {else} -->
<!-- {/if} -->
5、CSS文件
#picBox{width:534px; height:232px; overflow:hidden; position:relative; z-index:999;border:1px solid #0000ff}
#picBox ul#show_pic{height:202px; width:3050px; position:absolute;}
#picBox ul#show_pic li{ float:left; height:202px;}
#picBox ul#show_pic li img{ display:block; width:534px;height:200px}
#icon_num{ position:absolute; bottom:0px; left:0px;width:534px; overflow:hidden;}
#icon_num li { float:left;background:#565662; font-weight:bold;color:#fff; display:block;cursor:pointer;width:135px;padding:5px;text-align:center; border-right:1px solid #fff; font-size:13px;}
#icon_num li:hover,#icon_num li.active{ background:#000000; color: red;}
本文标签:
很赞哦! ()
相关文章
随机图文
-
ecshop3.6 H5网路错误怎么办,ecshop3.6 h5网路错误解决方法
ECSHOP3.6 H5网路错误,请稍后再试,很多人跑来问为什么ecshop h5网络错误,ECSHOP模板屋排查了下ECSHOP3.6 H5网络错误,会 -
ecshop商品分类列表按商品商家备注排序
打开 includes/lib_goods.php 这个文件搜索ORDER BY g.sort_order, g.last_update DESC替换 -
ecshop首页怎么添加商品分类下的品牌
有时我们需要在网站首页添加某个分类下的品牌,这就需要做些ecshop的二次开发,我写了一个简单的函数只要放在index.php中直接调用就ok了。 -
ecshop订单合并,商品合并订单的方法
各位ECSHOP网店系统用户大家好,欢迎来到ECSHOP教程网图文教程,今天为大家详细解说一下ECSHOP合并订单,ECSHOP商品合并订单 。 ECSH
留言与评论 (共有 条评论) |