Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

登陆页面Input框自动获得焦点方便填写

[复制链接]
tonyshoo2001 发表于 2005-5-10 15:40:26 | 显示全部楼层 |阅读模式
登陆页面Input框自动获得焦点方便填写

主要适用iscuz V 2.5
难度:超级简单
改动文件:依情况而定(偶改的就是login登陆页面)
----------------------
例如在login 页面,需要将鼠标点击输入框,而我们只要一点点改动,就能使鼠标在晃到

输入框上方时自动获得焦点,很是方便

---------------------

具体方法:

1.更改”用户“处:
<tr>
<td bgcolor="{ALTBG1}" width="21%">{lang username}:</td>
<td bgcolor="{ALTBG2}"><input type="text" name="username" size="25" maxlength="40" tabindex="1"> &nbsp;<span class="smalltxt"><a href="register.php">{lang register_now}</a></span></td>
</tr>


改为:

<tr>
<td bgcolor="{ALTBG1}" width="21%">{lang username}:</td>
<td bgcolor="{ALTBG2}"><input type="text" name="username" size="25" maxlength="40" tabindex="1" value="" onMouseOver="this.focus()" onMouseOut="if(this.value=='')this.value='';" onFocus="this.select()" onClick="if(this.value=='')this.value=''"> &nbsp;<span class="smalltxt"><a href="register.php">{lang register_now}</a></span></td>
</tr>


类似
2.“密码”处


<tr>
<td bgcolor="{ALTBG1}">{lang password}:</td>
<td bgcolor="{ALTBG2}"><input type="password" name="password" size="25"
tabindex="2"> &nbsp;<span class="smalltxt"><a href="member.php?action=lostpasswd">{lang lostpassword}</a></span></td>
</tr>


改为:

<tr>
<td bgcolor="{ALTBG1}">{lang password}:</td>
<td bgcolor="{ALTBG2}"><input type="password" name="password" size="25"
tabindex="2" value="" onMouseOver="this.focus()" onMouseOut="if(this.value=='')this.value='';" onFocus="this.select()" onClick="if(this.value=='')this.value=''"> &nbsp;<span class="smalltxt"><a href="member.php?action=lostpasswd">{lang lostpassword}</a></span></td>
</tr>



---------------------------
原理:

就是将input框的代码语句改动一下,在其参数里面增加

value="" onMouseOver="this.focus()" onMouseOut="if(this.value=='')this.value='';" onFocus="this.select()" onClick="if(this.value=='')this.value=''"


即可获得响应事件的功能

------------------------------

可以参见我的”蓝斑狗狗“
http://dogo.zj.com

[ Last edited by tonyshoo2001 on 2005-5-11 at 21:07 ]
carlkyo 发表于 2005-5-10 15:47:22 | 显示全部楼层
是甚麼?美化..hack..有圖看嗎
thanks:)
回复

使用道具 举报

freddy 发表于 2005-5-10 15:48:15 | 显示全部楼层
是楼主原创吗?
回复

使用道具 举报

 楼主| tonyshoo2001 发表于 2005-5-10 18:02:48 | 显示全部楼层
恩,包括“小巧倒记时”两个小插件都是我在整理自己网站的时候制作的

发表是希望能帮助其他朋友

以及大家相互交流
回复

使用道具 举报

freddy 发表于 2005-5-10 18:04:16 | 显示全部楼层
楼主最好带一张演示图!
然后把你的网址也贴出来!让某些会员可以实地演示!
这不算广告~
我有空测一下,没有问题就加精了!
回复

使用道具 举报

 楼主| tonyshoo2001 发表于 2005-5-10 18:05:27 | 显示全部楼层
我举个例子把

http://www.jzzy.com

这个网站你在登陆的 时候会发现你在准备输入用户名等资料的时候

光标被自动吸引到了输入框

大家可以采取这种方法使得自己的网站在用户操作起来

相当的方便
回复

使用道具 举报

 楼主| tonyshoo2001 发表于 2005-5-10 18:08:08 | 显示全部楼层
还有一个“小巧倒记时”也希望尊敬的管理员大哥能看看值不植得加精

THX  A  LOT !
回复

使用道具 举报

亚龙 发表于 2005-5-10 19:48:20 | 显示全部楼层
呵呵,这个功能演示不出来的,说着也很麻烦的,我知道楼主的意思啦,不好说的。。。
回复

使用道具 举报

feng04 发表于 2005-5-10 20:55:23 | 显示全部楼层
剛才測試過
明白樓主表達的是什麽了
不過用處不算大
純粹支持
回复

使用道具 举报

freddy 发表于 2005-5-11 01:43:54 | 显示全部楼层
加精鼓励一下!我的论坛暂时用不着!HACK插件区靠大家!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-6-19 03:08 , Processed in 0.101248 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表