Chinaunix首页 | 论坛 | 博客
  • 博客访问: 150929
  • 博文数量: 89
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 70
  • 用 户 组: 普通用户
  • 注册时间: 2016-06-29 23:10
文章分类

全部博文(89)

文章存档

2016年(89)

我的朋友

分类: Web开发

2016-03-18 20:51:22

二话不说直接上效果图:

enter image de.ion here

实现原理:

1:css控制本来要显示的radio为一小矩形.

2:当点击此小矩形时,js使此radio选中,同时改变此小矩形的外观样式.

涉及的修改文件,请做好备份(default模板为例)

/themes/default/style.css

/themes/default/goods.dwt

注:此路径为待修改模板路径(default修改为你的模板文件夹名称).

一:控制样式

1.打开/themes/default/images/

添加test.gif图片show_mop.gif

2.打开/themes/default/style.css

最下面添加:

.catt{width:100%;height:auto;overflow:hidden;padding-bottom:5px;}
.catt a{border: #c8c9cd 1px solid;  text-align: center; background-color: #fff; margin-left:5px;margin-top:6px;padding-left: 10px;padding-right: 10px;display: block; white-space: nowrap; color: #000; text-decoration: none;float:left;}
.catt a:hover {border:#ED0036 2px solid; margin: -1px; margin-left:4px;margin-top:5px;}
.catt a:focus {outline-style:none;}
.catt .cattsel {border:#ED0036 2px solid; margin: -1px;background: url("images/test.gif") no-repeat bottom right; margin-left:4px;margin-top:5px;}
.catt .cattsel a:hover {border: #ED0036 2px solid;margin:-1px;background: url("images/test.gif") no-repeat bottom right;}

3.打开/themes/default/goods.dwt

注:以下修改以原版ecshop2.7.0版本default(模板名称)为基准 未修改前第347-351行

 
 

修改为:

二:增加js控制样式与选中行为 在页面内找到

这样的东西,在其后面添加一个js函数

function changeAtt(t) {
t.lastChild.checked='checked';
for (var i = 0; i

转载自:

阅读(631) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~