本帖最后由 穿过骨头抚摸你 于 2010-4-21 08:44 编辑
先看效果图,是玫瑰版19楼的搜索框添加天气预报与时间代码
下面说下修改方法:
在模板目录下编辑header文件,将- <DIV class="clearall nav_searchbox">
- <DIV id="searchform" class="searchformkm">
- <LABEL class="inp_text">
- <INPUT name="srchtxt" id="keywords" onblur="if (value ==''){value='输入关键字,搜你想要的...'}" onfocus="if (value =='输入关键字,搜你想要的...'){value =''}" value="输入关键字,搜你想要的..." />
- </LABEL>
- <label class="inp_radio inp_radio_active" id="km_on">
- <input type="radio" name="srchtype" value="title" checked="checked" onclick="$('km_on').className='inp_radio inp_radio_active';$('km_ons').className='inp_radio';" />
- 标题</label>
- <label class="inp_radio" id="km_ons">
- <input type="radio" name="srchtype" value="fulltext" onclick="$('km_on').className='inp_radio';$('km_ons').className='inp_radio inp_radio_active';" />
- 全文</label>
- <LABEL class="inp_radio">
- <INPUT type="radio" onclick="location.href='search.php?srchtype=trade'">
- 商品</LABEL>
- <LABEL class="inp_radio">
- <INPUT type="radio" onclick="location.href='search.php?srchtype=threadsort'">
- 分类信息</LABEL>
- <BUTTON name="searchsubmit" id="siteSearchButton" type="submit">搜 索</BUTTON>
- </DIV>
- </DIV>
复制代码 修改为:- <DIV class="clearall nav_searchbox">
- <DIV id="searchform" class="searchformkm">
- <label class="inp_text">
- 欢迎您,今天是
- <script language=JavaScript>
- today=new Date();
- function initArray(){
- this.length=initArray.arguments.length
- for(var i=0;i<this.length;i++)
- this[i+1]=initArray.arguments[i]}
- var d=new initArray(
- "星期日",
- "星期一",
- "星期二",
- "星期三",
- "星期四",
- "星期五",
- "星期六");
- document.write(
- "<font color=#444444 style='font-family: 宋体'> ",
- today.getYear(),"年",
- today.getMonth()+1,"月",
- today.getDate(),"日 ",
- d[today.getDay()+1],
- "</font>" );
- </script>
- </label>
- <LABEL class="inp_text"><iframe src="http://m.weather.com.cn/m/pn7/weather.htm?id=101100603T " width="195" height="20" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" allowtransparency="true" scrolling="no"></iframe>
- </LABEL>
- <LABEL class="inp_text">
- <INPUT name="srchtxt" id="keywords" onblur="if (value ==''){value='搜索有关阳城的信息...'}" onfocus="if (value =='搜索有关阳城的信息...'){value =''}" value="搜索有关阳城的信息..." />
- </LABEL>
- <label class="inp_radio inp_radio_active" id="km_on">
- <input type="radio" name="srchtype" value="title" checked="checked" onclick="$('km_on').className='inp_radio inp_radio_active';$('km_ons').className='inp_radio';" />
- 标题</label>
- <BUTTON name="searchsubmit" id="siteSearchButton" type="submit">搜 索</BUTTON>
- </DIV>
- </DIV>
复制代码 即可
请注意,这行代码为天气预报代码,请到http://service.weather.com.cn/plugin/forcast.shtml?id=pn7获取本地代码:- <iframe src="http://m.weather.com.cn/m/pn7/weather.htm?id=101100603T " width="195" height="20" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" allowtransparency="true" scrolling="no"></iframe>
复制代码 还有,搜索框变短:
css搜索inp_text,第二个,有个width改成310px就差不多了
另外,免费发布几个19楼商业版,喜欢的朋友请加群:21762696 |