ecshop开发心得.doc_第1页
ecshop开发心得.doc_第2页
ecshop开发心得.doc_第3页
ecshop开发心得.doc_第4页
ecshop开发心得.doc_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Ecshop开发心得 By 傅望一 用JS广告替换FLASH广告1.var glide =new function()function $id(id)return document.getElementById(id);this.layerGlide=function(auto,oEventCont,oSlider,sSingleSize,second,fSpeed,point) var oSubLi = $id(oEventCont).getElementsByTagName(li); var interval,timeout,oslideRange; var time=1; var speed = fSpeed var sum = oSubLi.length; var a=0; var delay=second * 1000; var setValLeft=function(s) return function() oslideRange = Math.abs(parseInt($id(oSlider).stylepoint); $id(oSlider).stylepoint =-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).stylepoint); $id(oSlider).stylepoint =-Math.ceil(oslideRange+(parseInt(s*sSingleSize) - oslideRange)*speed) +px; if(oslideRange=(sSingleSize * s) clearInterval(interval); a=s; function autoGlide() for(var c=0;csum;c+)oSubLic.className=; clearTimeout(interval); if(a=(parseInt(sum)-1) for(var c=0;csum;c+)oSubLic.className=; a=0; oSubLia.className=active; interval = setInterval(setValLeft(a),time); timeout = setTimeout(autoGlide,delay); else a+; oSubLia.className=active; interval = setInterval(setValRight(a),time); timeout = setTimeout(autoGlide,delay); if(auto)timeout = setTimeout(autoGlide,delay); for(var i=0;isum;i+) oSubLii.onmouseover = (function(i) return function() for(var c=0;c(sSingleSize * i) interval = setInterval(setValLeft(i),time); this.onmouseout=function()if(auto)timeout = setTimeout(autoGlide,delay); else if(Math.abs(parseInt($id(oSlider).stylepoint)(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,5,0.1,left);/* *glide.layerGlide(oEventCont,oSlider,sSingleSize,sec,fSpeed,point); *param auto type:bolean 是否自动滑动 当值是true的时候 为自动滑动 *param oEventCont type:object 包含事件点击对象的容器 *param oSlider type:object 滑动对象 *param sSingleSize type:number 滑动对象里单个元素的尺寸(width或者height) 尺寸是有point 决定 *param second type:number 自动滑动的延迟时间 单位/秒 *param fSpeed type:float 速率 取值在0.05-1之间 当取值是1时 没有滑动效果 *param point type:string left or top */将其上传至js目录,后台代码处添加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) $val4 = isset($val4) ? $val4 : 0; $flashdb = array(src=$val1,url=$val2,text=$val3,sort=$val4); return $flashdb; 3、寻找$smarty-assign(auction_list, index_get_auction(); / 拍卖活动,下面加上:$smarty-assign(playerdb, get_flash_xml(); / FLASHJS广告4. index_ad.lbi: var swf_width=534; var swf_height=370; foreach from=$playerdb item=item key=key /foreach foreach from=$playerdb item=item name=picsitem key=key li class=active $item.text|truncate:7 /foreach $ad.content $ad.content 5、CSS文件/*首页轮换js广告*/#picBoxwidth:534px; height:370px; overflow:hidden; position:relative; z-index:999;border:1px solid #CCCCCC#picBox ul#show_picheight: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:370px#icon_num position:absolute; bottom:2px; left:0px;width:534px; overflow:hidden; padding-left:3px; padding-right:3px;#icon_num li float:left;background:#cccccc;filter:alpha(opacity=80); /* IE 透明度20% */-moz-opacity:0.8; /* Moz FF 透明度10%*/opacity: 0.8; /* 支持CSS3的浏览器(FF 1.5也支持)透明度10%*/ font-weight:bold;color:#ff0000; border:1px #FF0000 solid

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论