日期:2014-05-16 浏览次数:20458 次
//切换效果 js
function switchTab(mark,index,count) {
?var curTab = document.getElementById("tab_"+mark+index)
?var curTab2 = document.getElementById("tab_"+mark+"0")
?var form = $("#form");
?var getvalue="";
?var finalvalue="";
?for(var i=0;i<=count;i++) {
?var tabObj = document.getElementById("tab_"+mark+i) ;
?if (i != index) {
??if (tabObj) {
???$(tabObj).attr("style","");
???}
??}
?}
?if (curTab) {
??$(curTab).attr("style","color:#fb2c0a;font-weight:bold;");
<%--??alert($(curTab2).attr("style"));--%>
??if(curTab.title!=curTab2.title)
??{
???$(curTab2).removeAttr("style");
??}
??
??
??getvalue=curTab.title;
??var getHiddenValue = document.getElementById("propertyID").value; //用隐藏域来进行传值
??if(""==getHiddenValue)
??{
??? $("#propertyIDs").attr("value",getvalue)
???formAction()
??}
??else
??{
<%--???alert(getvalue.substring(1,5));--%>
???if(getHiddenValue.indexOf(getvalue.substring(1,5)) ==-1)
???{
????finalvalue = getHiddenValue+","+getvalue;
???}
???else
???{
????var tempvalue=getHiddenValue.split(",")
????for(var i=0;i<tempvalue.length;i++)
????{
?????if(tempvalue[i].indexOf(getvalue.substring(1,5))>-1)
?????{
?<%--?????tempvalue[i]= getvalue;--%>
?<%--?????getHiddenValue.substring(tempvalue[i],getvalue)--%>
??????if(""!=finalvalue)
???????? {
????????? finalvalue= finalvalue+","+getvalue;
???????? }
??????else
??????{
???????finalvalue= getvalue;
??????}
??????
?????}
?????else
?????{
???????????????????? if(""!=finalvalue)
???????????????????? {
???????????????????? ?finalvalue = tempvalue[i]+","+finalvalue;
???????????????????? }
???????????????????? else{
?????????????????????
???????????????????? ?finalvalue = tempvalue[i]
???????????????????? }
?????}
????}
???}
<%--???alert(finalvalue)--%>
???????????? $("#propertyIDs").attr("value",finalvalue)
???formAction()
???
??}
??}
?
?
?return false;
?}
?
?
JSP 对选中的值进行加亮
?
?<li id="tab_50" onclick="switchTab(5,0,10)" title="'3101'" value="other" style="color:#fb2c0a;font-weight:bold;"><a id="inteSear0" style="cursor:pointer">全部</a></li>
???????????????????? <li id="tab_51" onclick="switchTab(5,1,10)" title="'3101003'" value="3101003"><a id="inteSear1" style="cursor:pointer">联通3G(WCDMA)</a></li>
???????????????????? <li id="tab_52" onclick="switchTab(5,2,10)" title="'3101004'" value="3101004"><a id="inteSear2" style="cursor:pointer">GSM+CDMA2000(双网)</a></li>
???????????????????? <li id="tab_53" onclick="switchTab(5,3,10)" title="'3101002'" value="\\'3101002\\'"><a id="inteSear3" style="cursor:pointer">移动3G(TD-SCDMA)</a></li>
???????????????????? <li id="tab_54" onclick="switchTab(5,4,10)" title="'3101001'" value="\\'3101001\\'"><a id="inteSear4" style="cursor:pointer">电信3G(CDMA2000)</a></li>
??????????????????? <li id="tab_55" onclick="switchTab(5,5,10)" title="'3101005'" value="\'3101005\'"><a id="inteSear5" style="cursor:pointer">GSM+CDMA(双网)</a></li>
???????????????????? <li id="tab_56" onclick="switchTab(5,6,10)" title="'3101009'" value="\'3101009\'"><a id="inteSear6" style="cursor:pointer">双卡双待</a></li>
???????????????????? <li id="tab_57" onclick="switchTab(5,7,10)" title="'3101007'" value="\'3101007\'"><a id="inteSear7" style="cursor:pointer">GSM</a></li>
???????????????????? <li id="tab_58" onclick="switchTab(5,8,10)