请选择 进入手机版 | 继续访问电脑版
 找回密码
 立即注册

ecshop教程:添加前台切换颜色功能

dwt文件中加入下面代码:
<link media="screen" href="{$ecs_css_path}" rel="stylesheet" type="text/css" title="{$ecs_css_path}" />
<link media="screen" href="/themes/kf518/style.css" rel="alternate stylesheet" type="text/css" title="style" />
<link media="screen" href="/themes/kf518/style_brown.css" rel="alternate stylesheet" type="text/css" title="style_brown" />
<link media="screen" href="/themes/kf518/style_pink.css" rel="alternate stylesheet" type="text/css" title="style_pink" />
<link media="screen" href="/themes/kf518/style_purple.css" rel="alternate stylesheet" type="text/css" title="style_purple" />
<link media="screen" href="/themes/kf518/style_red.css" rel="alternate stylesheet" type="text/css" title="style_red" />

适当位置载入js    js在附件中
<script type="text/javascript" src="路径/kf518.js"></script>

这段是改好的代码具体参照下
<link rel="icon" href="animated_favicon.gif" type="image/gif" />
<link media="screen" href="{$ecs_css_path}" rel="stylesheet" type="text/css" title="{$ecs_css_path}" />
<link media="screen" href="/themes/kf518/style.css" rel="alternate stylesheet" type="text/css" title="style" />
<link media="screen" href="/themes/kf518/style_brown.css" rel="alternate stylesheet" type="text/css" title="style_brown" />
<link media="screen" href="/themes/kf518/style_pink.css" rel="alternate stylesheet" type="text/css" title="style_pink" />
<link media="screen" href="/themes/kf518/style_purple.css" rel="alternate stylesheet" type="text/css" title="style_purple" />
<link media="screen" href="/themes/kf518/style_red.css" rel="alternate stylesheet" type="text/css" title="style_red" />
<link rel="alternate" type="application/rss+xml" title="RSS|{$page_title}" href="{$feed_url}" />
{* 包含脚本文件 *}
<script type="text/javascript" src="/themes/kf518/js/kf518.js"></script>

修改好的头部文件,图片路径自己修改下
<div id="ECS_MEMBERZONE">
    {insert_scripts files='transport.js,utils.js'}
              {* ECSHOP 提醒您:根据用户id来调用member_info.lbi显示不同的界面  *}{insert name='member_info'}   
<a title="默认风格" href="javascript:chooseStyle('{$ecs_css_path}',518)"></a>
<a title="商务蓝色" href="javascript:chooseStyle('style',518)"><img src="/themes/kf518/images/type_0.gif" /></a>
<a title="棕色风格" href="javascript:chooseStyle('style_brown',518)"><img src="/themes/kf518/images/typebrown_0.gif" /></a>
<a title="粉色风格" href="javascript:chooseStyle('style_pink',518)"><img src="/themes/kf518/images/typepink_0.gif" /></a>
<a title="紫色风格" href="javascript:chooseStyle('style_purple',518)"><img src="/themes/kf518/images/typepurple_0.gif" /></a>
<a title="红色风格" href="javascript:chooseStyle('style_red',518)"><img src="/themes/kf518/images/typered_0.gif" /></a>
   </div>

发表于 2016-12-24 11:23:59 | 显示全部楼层 |阅读模式

回复 | 使用道具 举报

该帖共收到 0 条回复!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

美图秀

    • 微擎微赞通用积分宝兑换商城支持二开
    • 微擎微赞通用人人商城带三级分销支持二开源
    • 微擎微赞通过版钻石投票系统
    • 微擎破解版框架下载
    • 营销型热能工程网站模版带手机版
网站建设
在线咨询
咨询热线
15365769823
微信扫一扫
直接访问本页内容