一、效果圖

二、前端代碼
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><title>Jquery分類</title> <script src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script><style type="text/css"> .templinkactive { padding:5px; text-decoration:none; color:red; } .templink { cursor:pointer; padding:5px; text-decoration:none; } table{border:1px solid #ccc;} table tr{ height:35px;} </style><script type="text/javascript"> $(function () { //品牌 var alink01 = $("#linktype01").find("span"); alink01.click(function () { alink01.each(function () { $(this).removeClass("templinkactive").addClass("templink"); }); $(this).removeClass("templink").addClass("templinkactive"); $("#Brand").val($(this).attr("tag")); SetPara(); }); //價(jià)格 var alink02 = $("#linktype02").find("span"); alink02.click(function () { alink02.each(function () { $(this).removeClass("templinkactive").addClass("templink"); }); $(this).removeClass("templink").addClass("templinkactive"); $("#Price").val($(this).attr("tag")); SetPara(); }) //尺寸 var alink03 = $("#linktype03").find("span"); alink03.click(function () { alink03.each(function () { $(this).removeClass("templinkactive").addClass("templink"); }); $(this).removeClass("templink").addClass("templinkactive"); $("#Size").val($(this).attr("tag")); SetPara(); }); }); function SetPara() { var Brand = $("#Brand").val(); var Price = $("#Price").val(); var Size = $("#Size").val(); alert("1.php?Brand=" + Brand + "&Price=" + Price + "&Size=" + Size); // var keywords = $("#search").val(); // var skip_url = "http://" + window.location.hostname + window.location.pathname; // var url = skip_url + "?s=/admin/goods/goods_list/Brand/"+Brand+"/Price/"+Price+"/Size/"+Size; // window.location.href = url; // alert(url); }; </script><script type="text/javascript"> /*//TP框架-start $(function(){ var Brand = $("#Brand").val(); var Price = $("#Price").val(); var Size = $("#Size").val(); // alert(tag); if(Brand != ''){ $("#linktype01").find("span").removeClass("templinkactive").addClass("templink") $('span[tag="'+Brand+'"]').css('color','red'); } if(Price != ''){ $("#linktype02").find("span").removeClass("templinkactive").addClass("templink") $('span[tag="'+Price+'"]').css('color','red'); } if(Size != ''){ $("#linktype03").find("span").removeClass("templinkactive").addClass("templink") $('span[tag="'+Size+'"]').css('color','red'); } }); //TP框架-end*/</script></head> <body> <form id="form1" runat="server"> <div> <table> <tr id="linktype01"> <td style="width:100px"> <b>筆記本品牌</b> </td> <td> <span class='templinkactive' tag="0">不限</span> </td> <td> <span class='templink' tag="100101">聯(lián)想(Lenovo)</span> </td> <td> <span class='templink' tag="100102">宏
主站蜘蛛池模板:
金山区|
金寨县|
通河县|
永济市|
靖边县|
泌阳县|
南城县|
讷河市|
灌云县|
罗江县|
赤峰市|
登封市|
特克斯县|
百色市|
泾阳县|
门源|
滦南县|
唐海县|
鹿邑县|
金溪县|
宁安市|
天津市|
荣昌县|
绥化市|
临漳县|
滦平县|
辰溪县|
陇西县|
和林格尔县|
临西县|
司法|
阿拉善盟|
柘荣县|
东安县|
新沂市|
阜康市|
资阳市|
库伦旗|
清水河县|
淳安县|
淅川县|