|
突然想提个需求,能不能把查看新消息的接口放在可以直接点击的地方,手机不太好触发那个动画效果。 应群众的要求,今天改了一下页首的样式。
以前是光秃秃的banner,只有一个圈圈显示头像。当鼠标移动到头像附近时会显示这么个下拉菜单:
然后才能点击里面的内容。不过这种操作在手机上不好触发,于是我还是决定把里面这些可以点击的项目都搬出来。反正上边栏空着也是空着。
现在改完以后是这样的:
有什么消息提醒之类的,对应项目上会有提示。
仔细看了下代码,这个内容归“header.php”这个文件管。我用的这个template里,自定义的header.php里有这么一段:
- <!--{ad/headerbanner/wp a_h}-->
- <!--{template common/header_m_top}-->
- <!--{hook/global_header}-->
复制代码 把内容扔给了“header_m_top.php”。我又打开header_m_top.php,里面有这么一段:
- <a href="javascript:;" id="qmenu" onMouseOver="delayShow(this, function () {showMenu({'ctrlid':'qmenu','pos':'34!','ctrlclass':'a','duration':2});showForummenu($_G[fid]);})">{lang my_nav}</a>
- <!--{template common/header_userstatus_dl}-->
复制代码 我仔细inspect过了html,关于这个下拉菜单的内容确实都在“header_userstatus_dl.php”这个文件里。于是我复制了一个“header_userstatus_dl_ellie.php”让上述代码的第二行调用。把中间显示的部分改成:
- <div class="m-user-ellie y">
- <div class="m-uimg"><a href="home.php?mod=space&uid=$_G[uid]"><!--{avatar($_G[uid],middle)}--></a></div>
- <!--{if $_G[member][newprompt]}--><div class="m-umem-ellie">$_G[member][newprompt]</div><!--{/if}-->
- <span class="y">
- <strong class="vwmy{if $_G['setting']['connect']['allow'] && $_G[member][conisbind]} qq{/if}"><a href="home.php?mod=space&uid=$_G[uid]" target="_blank" title="{lang visit_my_space}">{$_G[member][username]}</a></strong>
- <!--{if $_G['group']['allowinvisible']}-->
- <span id="loginstatus">
- <a id="loginstatusid" href="member.php?mod=switchstatus" title="{lang login_switch_invisible_mode}" onclick="ajaxget(this.href, 'loginstatus');return false;" class="xi2"></a>
- </span>
- <!--{/if}-->
- <span class="pipe">|</span>
- <a href="home.php?mod=spacecp&ac=usergroup" id="g_upmine" class="showmenu" onmouseover="delayShow(this, showUpgradeinfo)">{lang usergroup}: $_G[group][grouptitle]</a>
- <!--{hook/global_usernav_extra1}-->
- <span class="pipe">|</span>
- <a href="home.php?mod=spacecp&ac=credit&showcredit=1" id="extcreditmenu"{if !$_G[setting][bbclosed]} onmouseover="delayShow(this, showCreditmenu);" class="showmenu"{/if}>{lang credits}: $_G[member][credits]</a>
- <span class="pipe">|</span>
- <a href="home.php?mod=space&do=notice" id="myprompt" onmouseover="showMenu({'ctrlid':'myprompt'});">{lang remind}<!--{if $_G[member][newprompt]}-->($_G[member][newprompt])<!--{/if}--></a><span id="myprompt_check"></span>
- <!--{hook/global_usernav_extra4}-->
- <span class="pipe">|</span>
- <a href="home.php?mod=spacecp">{lang setup}</a>
- <span class="pipe">|</span>
- <a href="home.php?mod=space&do=pm" id="pm_ntc"{if $_G[member][newpm]} class="new"{/if}>{lang pm_center}</a>
- <span class="pipe">|</span>
- <a href="member.php?mod=logging&action=logout&formhash={FORMHASH}" style="font-weight:bold">{lang logout}</a>
- <!--{hook/global_usernav_extra3}-->
-
- <!--{if empty($_G['cookie']['ignore_notice']) && ($_G[member][newpm] || $_G[member][newprompt_num][follower] || $_G[member][newprompt_num][follow] || $_G[member][newprompt])}--><script language="javascript">delayShow($('myprompt'), function() {showMenu({'ctrlid':'myprompt','duration':3})});</script><!--{/if}-->
- <!--{if $_G['setting']['taskon'] && !empty($_G['cookie']['taskdoing_'.$_G['uid']])}-->
- <span class="pipe">|</span><a href="home.php?mod=task&item=doing" id="task_ntc" class="new">{lang task_doing}</a>
- <!--{/if}-->
- <!--{if ($_G['group']['allowmanagearticle'] || $_G['group']['allowpostarticle'] || $_G['group']['allowdiy'] || getstatus($_G['member']['allowadmincp'], 4) || getstatus($_G['member']['allowadmincp'], 6) || getstatus($_G['member']['allowadmincp'], 2) || getstatus($_G['member']['allowadmincp'], 3))}-->
- <span class="pipe">|</span><a href="portal.php?mod=portalcp"><!--{if $_G['setting']['portalstatus'] }-->{lang portal_manage}<!--{else}-->{lang portal_block_manage}<!--{/if}--></a>
- <!--{/if}-->
- <!--{if $_G['uid'] && getstatus($_G['member']['allowadmincp'], 1)}-->
- <span class="pipe">|</span><a href="admin.php" target="_blank">{lang admincp}</a>
- <!--{/if}-->
- <!--{if $_G['uid'] && $_G['adminid'] == 1 && $_G['setting']['cloud_status']}-->
- <span class="pipe">|</span><a href="admin.php?frames=yes&action=cloud&operation=applist" target="_blank">{lang cloudcp}</a>
- <!--{/if}-->
- <!--{if $_G['uid'] && $_G['group']['radminid'] > 1}-->
- <span class="pipe">|</span><a href="forum.php?mod=modcp&fid=$_G[fid]" target="_blank">{lang forum_manager}</a>
- <!--{/if}-->
- <!--{hook/global_usernav_extra2}-->
- <span style="padding-right:50px"> </span>
- </span>
-
- </div>
复制代码 并在“extend_common.css”里添加了相应的格式:
- /*Ellie's addition*/
- .m-user-ellie{position:relative;z-index:300;margin-top:-12px;width:900;height:62px;line-height:62px}
- .m-user-ellie .m-uimg{position:absolute;top:0;right:0;z-index:102;width:50px;height:50px; overflow:hidden;border:6px solid #1bbc9b;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;}
- .m-user-ellie .m-uimg a{width:50px;height:50px;display:block; overflow:hidden;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;}
- .m-user-ellie .m-uimg img{width:50px;min-height:50px;}
- .m-user-ellie .y{position:relative;padding:0 20px 0 20px;color:#FFF}
- .m-user-ellie .y a{color:#FFF;line-height:40px;cursor:pointer}
- .m-user-ellie .m-umem{position:absolute;top:0;right:40px;z-index:103;overflow:hidden;width:20px;height:20px;border:2px solid #1bbc9b;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;background-color:#FFF;color:#ef8c39;text-align:center;line-height:20px}
- /*END*/
复制代码 更新css缓存查看结果。反复调试了几次样式,现在好像差不多了。
|
|