日期:2014-05-17 浏览次数:20730 次
if(document.getElementById("隐藏域").value=="") {document.getElementById("隐藏域").value =document.getElementById("a1").href; document.getElementById("a1").href="";}else{ document.getElementById("a2").href=document.getElementById("隐藏域").value; document.getElementById("隐藏域").value =document.getElementById("a1").href; document.getElementById("a1").href=""; } a2事件 document.getElementById("a1").href=document.getElementById("隐藏域").value ; document.getElementById("隐藏域").value =document.getElementById("a2").href; document.getElementById("a2").href=""; <a>a1</a><a>a2</a> <input id="隐藏" value>
------解决方案--------------------
<script type="text/javascript"> var a3="true"; var a4="true"; $(document).ready(function(){ $("#a3").bind({ "click":function(){ if(a3=="true"){ window.open("www.baidu.com","_blank"); a3="false"; a4="true"; } }, "mouseover":function(){ if(a3=="true"){ $("#a3").css("text-decoration","underline"); $("#a3").css("cursor","hand"); } }, "mouseout":function(){ if(a3=="true"){ $("#a3").css("text-decoration",""); $("#a3").css("cursor",""); } }, "mouseup":function(){ if(a3=="true"){ $("#a3").css("text-decoration",""); $("#a3").css("cursor",""); } } }); $("#a4").bind({ "click":function(){ if(a4=="true"){ window.open("www.google.com","_blank"); a4="false"; a3="true"; } }, "mouseover":function(){ if(a4=="true"){ $("#a4").css("text-decoration","underline"); $("#a4").css("cursor","hand"); } }, "mouseout":function(){ if(a4=="true"){