目前有个 div 定义了样式, div 嵌套里面的链接又定义了样式如果我把 <a href="#" onclick="js();">跳转</a> 中的 href 去掉, 样式的效果就没有了.如果我加上, 点击触发事件就不会发生了(form表单提交和js验证)。我该如何处理呢 ,直接上代码吧
/**/
/* global */
* {word-break:break-all;font-family:Verdana,Arial;}
body {background:#FFFFFF;color:#000000;font-size:12px;margin:0px;height:100%;}
input,textarea,select,button,td {font-size:12px;}
img {border:none;}
li {list-style-type:none;}
ul,form {margin:0px;padding:0px;}
html {height:100%;}
a:link,a:visited,a:active {text-decoration:none;color:#000000;}
a:hover {color:#FF0000;text-decoration:none;}
a.t:link,a.t:visited,a.t:active {text-decoration:none;color:#0240A3;}
a.t:hover {color:#FF0000;}
a.w:link,a.w:visited,a.w:active {text-decoration:none;color:#FFFFFF;}
a.w:hover {color:#FAFAFA;}
a.b:link,a.b:visited,a.b:active {text-decoration:none;color:#005590;}
a.b:hover{color:#FF0000;}
a.l:link,a.l:visited,a.l:active {text-decoration:underline;color:#005590;}
a.l:hover{color:#FF0000;}
a.n:link,a.n:visited,a.n:active {text-decoration:none;display:block;width:125px;color:#005590;font-size:14px;}
a.n:hover{color:#FF6600;}
a.m:link,a.m:visited,a.m:active {color:#666666;text-decoration:none;}
a.m:hover {color:#FF6600;}
a.f:link,a.f:visited,a.f:active,a.f:hover {text-decoration:none;display:block;width:125px;color:#888888;font-size:14px;}.head {background:#FFFFFF url('head_bg.gif') repeat-x 0 bottom;padding:0 0 5px 0;}
#top {padding:5px 8px 4px 8px;border-bottom:#F0F0F0 1px solid;color:#929393;}
#top a {color:#555555;}
#m_menu {z-index:1000;position:absolute;left:190px;border:#F0F0F0 1px solid;border-top:#FFFFFF 1px solid;margin-top:-1px;background:#FFFFFF;width:70px;overflow:hidden;filter:Alpha(opacity=90);-moz-opacity:0.9;}
#m_menu a {text-decoration:none;height:22px;line-height:22px;padding:0 0 0 10px;width:100%;display:block;}
#m_menu a:hover {color:#FFFFFF;background:#2764A4;}.head_sch {text-align:right;padding:0 8px 0 0;}
.head_user {color:#3C3C3C;}
#head_kw {border:#6C92AD 1px solid;padding:2px;color:#666666;background:url('head_sch.gif') no-repeat right center;}
#head_bt {z-index:1;position:absolute;width:62px;height:20px;margin:0 0 0 -62px;}.side {background:url('side_bg.gif') repeat-y;width:190px;}
.side_head {width:189px;height:28px;background:url('side_head.gif') repeat-x;overflow:hidden;cursor:pointer;}
.side_head div {padding:4px 3px 0 8px;color:#005590;line-height:22px;font-weight:bold;font-size:14px;}
.side_body {clear:both;}
.side_a {padding:4px 10px 4px 20px;line-height:18px;background:url('side_li.gif') no-repeat 7px 8px;}
.side_b {padding:5px 10px 5px 20px;line-height:18px;
border-bottom:#2A6BA6 1px solid;border-top:#2A6BA6 1px solid;background:#FFFFFF url('side_li.gif') no-repeat 7px 8px;}
.side_c {padding:4px 9px 4px 20px;line-height:18px;border-right:#2A6BA6 1px solid;background:#FAFAFA url('side_li.gif') no-repeat 7px 8px;}
.side_h {width:8px;background:url('side_hide.gif') no-repeat 0 280px;cursor:pointer;}
.side_s {width:8px;background:url('side_show.gif') no-repeat 0 280px;cursor:pointer;}
.main {padding:8px 0 0 0;}.bg {background:#FAFAFA;}
.r {border-bottom:#D3DBE7 1px solid;height:24px;}
.r span{color:#BBBBBB;}
.d {line-height:180%;border-bottom:#D3DBE7 1px solid;border-right:#D3DBE7 1px solid;}.menu {padding:8px 0 0 15px;background:url('menu_bg.gif') repeat-x;height:35px;overflow:hidden;}
.menu tables {margin-top:8px;}
.tab_nav {width:3px;}
.tab {height:19px;line-height:18px;letter-spacing:1px;}
.tab a:link,.tab a:visited,.tab a:active {text-decoration:none;color:#001C30;display:block;height:19px;line-height:18px;padding:5px 12px 2px 12px;}
.tab a:hover {background:#F6F9FC;color:#FF3300;}
.tab_on {height:19px;line-height:18px;background:#FFFFFF;border:#9CB8CC 1px solid;border-bottom:none;font-weight:bold;}
.tab_on a:link,.tab_on a:visited,.tab_on a:active,.tab_on a:hover {text-decoration:none;display:block;height:19px;line-height:18px;padding:5px 15px 2px 15px;color:#333333;}
#add span {background:url('add_bg.gif') no-repeat;padding:0 0 0 18px;}==============================================================<div class="menu">
<table cellpadding="0" cellspacing="0" >
<tbody><tr>
<td class="tab" onClick="supplyAdd();"><a href="" ><span>发布供应</span></a></td>
<td class="tab_nav"> </td>
<td class="tab_on" id="s3"><a href="" onClick="supplyList(0);" ><span>初始化<span class="px10">(7)</span></span></a></td>
<td class="tab_nav"> </td>
<td class="tab" id="s2"><a href="" onClick="supplyList(1);" ><span>审核中<span class="px10">(0)</span></span></a></td>
<td class="tab_nav"> </td>
<td class="tab" id="s1"><a onClick="supplyList(3);" ><span>未通过<span class="px10">(0)</span></span></a></td>
<td class="tab_nav"> </td>
<td class="tab" id="s4"><a onClick="supplyList(2);"><span>已发布<span class="px10">(1)</span></span></a></td><!---->
</tr>
</tbody></table>
</div>
/**/
/* global */
* {word-break:break-all;font-family:Verdana,Arial;}
body {background:#FFFFFF;color:#000000;font-size:12px;margin:0px;height:100%;}
input,textarea,select,button,td {font-size:12px;}
img {border:none;}
li {list-style-type:none;}
ul,form {margin:0px;padding:0px;}
html {height:100%;}
a:link,a:visited,a:active {text-decoration:none;color:#000000;}
a:hover {color:#FF0000;text-decoration:none;}
a.t:link,a.t:visited,a.t:active {text-decoration:none;color:#0240A3;}
a.t:hover {color:#FF0000;}
a.w:link,a.w:visited,a.w:active {text-decoration:none;color:#FFFFFF;}
a.w:hover {color:#FAFAFA;}
a.b:link,a.b:visited,a.b:active {text-decoration:none;color:#005590;}
a.b:hover{color:#FF0000;}
a.l:link,a.l:visited,a.l:active {text-decoration:underline;color:#005590;}
a.l:hover{color:#FF0000;}
a.n:link,a.n:visited,a.n:active {text-decoration:none;display:block;width:125px;color:#005590;font-size:14px;}
a.n:hover{color:#FF6600;}
a.m:link,a.m:visited,a.m:active {color:#666666;text-decoration:none;}
a.m:hover {color:#FF6600;}
a.f:link,a.f:visited,a.f:active,a.f:hover {text-decoration:none;display:block;width:125px;color:#888888;font-size:14px;}.head {background:#FFFFFF url('head_bg.gif') repeat-x 0 bottom;padding:0 0 5px 0;}
#top {padding:5px 8px 4px 8px;border-bottom:#F0F0F0 1px solid;color:#929393;}
#top a {color:#555555;}
#m_menu {z-index:1000;position:absolute;left:190px;border:#F0F0F0 1px solid;border-top:#FFFFFF 1px solid;margin-top:-1px;background:#FFFFFF;width:70px;overflow:hidden;filter:Alpha(opacity=90);-moz-opacity:0.9;}
#m_menu a {text-decoration:none;height:22px;line-height:22px;padding:0 0 0 10px;width:100%;display:block;}
#m_menu a:hover {color:#FFFFFF;background:#2764A4;}.head_sch {text-align:right;padding:0 8px 0 0;}
.head_user {color:#3C3C3C;}
#head_kw {border:#6C92AD 1px solid;padding:2px;color:#666666;background:url('head_sch.gif') no-repeat right center;}
#head_bt {z-index:1;position:absolute;width:62px;height:20px;margin:0 0 0 -62px;}.side {background:url('side_bg.gif') repeat-y;width:190px;}
.side_head {width:189px;height:28px;background:url('side_head.gif') repeat-x;overflow:hidden;cursor:pointer;}
.side_head div {padding:4px 3px 0 8px;color:#005590;line-height:22px;font-weight:bold;font-size:14px;}
.side_body {clear:both;}
.side_a {padding:4px 10px 4px 20px;line-height:18px;background:url('side_li.gif') no-repeat 7px 8px;}
.side_b {padding:5px 10px 5px 20px;line-height:18px;
border-bottom:#2A6BA6 1px solid;border-top:#2A6BA6 1px solid;background:#FFFFFF url('side_li.gif') no-repeat 7px 8px;}
.side_c {padding:4px 9px 4px 20px;line-height:18px;border-right:#2A6BA6 1px solid;background:#FAFAFA url('side_li.gif') no-repeat 7px 8px;}
.side_h {width:8px;background:url('side_hide.gif') no-repeat 0 280px;cursor:pointer;}
.side_s {width:8px;background:url('side_show.gif') no-repeat 0 280px;cursor:pointer;}
.main {padding:8px 0 0 0;}.bg {background:#FAFAFA;}
.r {border-bottom:#D3DBE7 1px solid;height:24px;}
.r span{color:#BBBBBB;}
.d {line-height:180%;border-bottom:#D3DBE7 1px solid;border-right:#D3DBE7 1px solid;}.menu {padding:8px 0 0 15px;background:url('menu_bg.gif') repeat-x;height:35px;overflow:hidden;}
.menu tables {margin-top:8px;}
.tab_nav {width:3px;}
.tab {height:19px;line-height:18px;letter-spacing:1px;}
.tab a:link,.tab a:visited,.tab a:active {text-decoration:none;color:#001C30;display:block;height:19px;line-height:18px;padding:5px 12px 2px 12px;}
.tab a:hover {background:#F6F9FC;color:#FF3300;}
.tab_on {height:19px;line-height:18px;background:#FFFFFF;border:#9CB8CC 1px solid;border-bottom:none;font-weight:bold;}
.tab_on a:link,.tab_on a:visited,.tab_on a:active,.tab_on a:hover {text-decoration:none;display:block;height:19px;line-height:18px;padding:5px 15px 2px 15px;color:#333333;}
#add span {background:url('add_bg.gif') no-repeat;padding:0 0 0 18px;}==============================================================<div class="menu">
<table cellpadding="0" cellspacing="0" >
<tbody><tr>
<td class="tab" onClick="supplyAdd();"><a href="" ><span>发布供应</span></a></td>
<td class="tab_nav"> </td>
<td class="tab_on" id="s3"><a href="" onClick="supplyList(0);" ><span>初始化<span class="px10">(7)</span></span></a></td>
<td class="tab_nav"> </td>
<td class="tab" id="s2"><a href="" onClick="supplyList(1);" ><span>审核中<span class="px10">(0)</span></span></a></td>
<td class="tab_nav"> </td>
<td class="tab" id="s1"><a onClick="supplyList(3);" ><span>未通过<span class="px10">(0)</span></span></a></td>
<td class="tab_nav"> </td>
<td class="tab" id="s4"><a onClick="supplyList(2);"><span>已发布<span class="px10">(1)</span></span></a></td><!---->
</tr>
</tbody></table>
</div>
解决方案 »
- =====easy ui datagrid如何添加右键菜单,实现右键删除功能?===
- ♠ 求扫盲,有用过jqgrid的朋友请进来 ♠
- 表单的提交
- 求兼容FF和IE的关闭默认车事件 所有多行文本框例外的代码
- [新手]jsp如何获取ext formpanel里的数据?
- 菜鸟求助:javascript的键盘事件问题
- 有没有办法让window.showModalDialog打开的窗口没有标题栏?
- 使用javascript能不能上传文件?最好是一下子上传多个,呵呵!谢谢!!
- 小弟想做一个下拉菜单,哪位前辈指点一二,例子也可
- 请问怎样用JavaScript使浏览器的后退按钮不起作用。
- 求教extjs 4 浏览器内存释放问题
- chrome 图片上传前预览
也就是说js代码提交表单以后会改变当前页面的效果就没有了。<div class="menu"> 这里只是头,还有下面内容的部分,是需要改变的
/* global */
* {word-break:break-all;font-family:Verdana,Arial;}
body {background:#FFFFFF;color:#000000;font-size:12px;margin:0px;height:100%;}
input,textarea,select,button,td {font-size:12px;}
img {border:none;}
li {list-style-type:none;}
ul,form {margin:0px;padding:0px;}
html {height:100%;}
a:link,a:visited,a:active {text-decoration:none;color:#000000;}
a:hover {color:#FF0000;text-decoration:none;}
a.t:link,a.t:visited,a.t:active {text-decoration:none;color:#0240A3;}
a.t:hover {color:#FF0000;}
a.w:link,a.w:visited,a.w:active {text-decoration:none;color:#FFFFFF;}
a.w:hover {color:#FAFAFA;}
a.b:link,a.b:visited,a.b:active {text-decoration:none;color:#005590;}
a.b:hover{color:#FF0000;}
a.l:link,a.l:visited,a.l:active {text-decoration:underline;color:#005590;}
a.l:hover{color:#FF0000;}
a.n:link,a.n:visited,a.n:active {text-decoration:none;display:block;width:125px;color:#005590;font-size:14px;}
a.n:hover{color:#FF6600;}
a.m:link,a.m:visited,a.m:active {color:#666666;text-decoration:none;}
a.m:hover {color:#FF6600;}
a.f:link,a.f:visited,a.f:active,a.f:hover {text-decoration:none;display:block;width:125px;color:#888888;font-size:14px;}.head {background:#FFFFFF url('head_bg.gif') repeat-x 0 bottom;padding:0 0 5px 0;}
#top {padding:5px 8px 4px 8px;border-bottom:#F0F0F0 1px solid;color:#929393;}
#top a {color:#555555;}
#m_menu {z-index:1000;position:absolute;left:190px;border:#F0F0F0 1px solid;border-top:#FFFFFF 1px solid;margin-top:-1px;background:#FFFFFF;width:70px;overflow:hidden;filter:Alpha(opacity=90);-moz-opacity:0.9;}
#m_menu a {text-decoration:none;height:22px;line-height:22px;padding:0 0 0 10px;width:100%;display:block;}
#m_menu a:hover {color:#FFFFFF;background:#2764A4;}.head_sch {text-align:right;padding:0 8px 0 0;}
.head_user {color:#3C3C3C;}
#head_kw {border:#6C92AD 1px solid;padding:2px;color:#666666;background:url('head_sch.gif') no-repeat right center;}
#head_bt {z-index:1;position:absolute;width:62px;height:20px;margin:0 0 0 -62px;}.side {background:url('side_bg.gif') repeat-y;width:190px;}
.side_head {width:189px;height:28px;background:url('side_head.gif') repeat-x;overflow:hidden;cursor:pointer;}
.side_head div {padding:4px 3px 0 8px;color:#005590;line-height:22px;font-weight:bold;font-size:14px;}
.side_body {clear:both;}
.side_a {padding:4px 10px 4px 20px;line-height:18px;background:url('side_li.gif') no-repeat 7px 8px;}
.side_b {padding:5px 10px 5px 20px;line-height:18px;
border-bottom:#2A6BA6 1px solid;border-top:#2A6BA6 1px solid;background:#FFFFFF url('side_li.gif') no-repeat 7px 8px;}
.side_c {padding:4px 9px 4px 20px;line-height:18px;border-right:#2A6BA6 1px solid;background:#FAFAFA url('side_li.gif') no-repeat 7px 8px;}
.side_h {width:8px;background:url('side_hide.gif') no-repeat 0 280px;cursor:pointer;}
.side_s {width:8px;background:url('side_show.gif') no-repeat 0 280px;cursor:pointer;}
.main {padding:8px 0 0 0;}.bg {background:#FAFAFA;}
.r {border-bottom:#D3DBE7 1px solid;height:24px;}
.r span{color:#BBBBBB;}
.d {line-height:180%;border-bottom:#D3DBE7 1px solid;border-right:#D3DBE7 1px solid;}.menu {padding:8px 0 0 15px;background:url('menu_bg.gif') repeat-x;height:35px;overflow:hidden;}
.menu tables {margin-top:8px;}
.tab_nav {width:3px;}
.tab {height:19px;line-height:18px;letter-spacing:1px;}
.tab a:link,.tab a:visited,.tab a:active {text-decoration:none;color:#001C30;display:block;height:19px;line-height:18px;padding:5px 12px 2px 12px;}
.tab a:hover {background:#F6F9FC;color:#FF3300;}
.tab_on {height:19px;line-height:18px;background:#FFFFFF;border:#9CB8CC 1px solid;border-bottom:none;font-weight:bold;}
.tab_on a:link,.tab_on a:visited,.tab_on a:active,.tab_on a:hover {text-decoration:none;display:block;height:19px;line-height:18px;padding:5px 15px 2px 15px;color:#333333;}
#add span {background:url('add_bg.gif') no-repeat;padding:0 0 0 18px;}
<a href="javascript:void(0)" onclick="js();">