查看: 2368|回复: 2
|
1、打开header模板找到在下边加- {eval $set_pwh = $_COOKIE["set_pwh"];}
复制代码 2、找到在上边加- <a href="javascript:;" id="switchwidth" onclick="setcookie('set_pwh', 1, 999999);location.reload();" href="javascript:;" title="切换到宽版" class="switchwidth" {if $set_pwh == 1}style="display: none;"{/if}>
- 切换到宽版
- </a>
- <a href="javascript:;" id="snarrow" onclick="setcookie('set_pwh', 2, 999999);location.reload();" href="javascript:;" title="切换到窄版" class="snarrow" {if $set_pwh == 2}style="display: none;"{elseif $set_pwh == 1}style="display: block;"{else}style="display: none;"{/if}>
- 切换到窄版
- </a>
复制代码 3、找到- <div class="wrap s_clear">
复制代码 修改为- <div class="wrap s_clear" {if $set_pwh == 1}style="width: 93%;"{elseif $set_pwh == 2}style="width: 960px;"{/if} >
复制代码 修改方法大同小异,无非是找到对应的div,在style加入判断。
{if $set_pwh == 1}style="width: 93%;"{elseif $set_pwh == 2}style="width: 960px;"{/if}
比如要修改<div id="menu">
修改后既是<div id="menu" {if $set_pwh == 1}style="width: 93%;"{elseif $set_pwh == 2}style="width: 960px;"{/if}>
也就是说当$set_pwh变量等于1时,设置宽度为93%,若变量$set_pwh等于2时设置宽度为960px。 |
|