<div class="codetitle"> <span><a style="CURSOR: pointer" data="94526" class="copybut" id="copybut94526" onclick="doCopy('code94526')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code94526"> <br> <br><br> <br><br> <br> <br><title>Jquery分类</title> <br><script src="../Scripts/jquery-1.4.4.min.js" type="text/javascript"></script> <br><script type="text/javascript"> <BR>$(function () { <BR>//品牌 <BR>var alink01 = $("#linktype01").find("span"); <BR>alink01.click(function () { <BR>alink01.each(function () { <BR>$(this).removeClass("templinkactive").addClass("templink"); <BR>}); <BR>$(this).removeClass("templink").addClass("templinkactive"); <BR>$("#Brand").val($(this).attr("tag")); <BR>}) <br><br>//价格 <BR>var alink02 = $("#linktype02").find("span"); <BR>alink02.click(function () { <BR>alink02.each(function () { <BR>$(this).removeClass("templinkactive").addClass("templink"); <BR>}); <BR>$(this).removeClass("templink").addClass("templinkactive"); <BR>$("#Price").val($(this).attr("tag")); <BR>}) <br><br>//尺寸 <BR>var alink03 = $("#linktype03").find("span"); <BR>alink03.click(function () { <BR>alink03.each(function () { <BR>$(this).removeClass("templinkactive").addClass("templink"); <BR>}); <BR>$(this).removeClass("templink").addClass("templinkactive"); <BR>$("#Size").val($(this).attr("tag")); <BR>SetPara(); <BR>}) <BR>}); <br><br><BR>function SetPara() { <BR>var a = $("#Brand").val(); <BR>var b = $("#Price").val(); <BR>var c = $("#Size").val(); <BR>alert("1.aspx?a=" + a + "&b=" + b + "&c=" + c); <BR>}; <BR></script> <br><style type="text/css"> <BR>.templinkactive <BR>{ <BR>padding:5px; <BR>text-decoration:none; <BR>background-color: #2788DA; <BR>color:#ffffff; <BR>} <BR>.templink <BR>{ <BR>cursor:pointer; <BR>padding:5px; <BR>text-decoration:none; <BR>} <BR>table tr{ height:35px;} <BR></style> <br> <br> <br><form id="form1" runat="server"> <br><div> <br><table> <br><tr id="linktype01"> <br><td style="width:100px"> <br><b>笔记本品牌</b> <br> </td> <br><td> <br><span class="templinkactive" tag="0">不限</span> <br> </td> <br><td> <br><span class="templink" tag="100101">联想(Lenovo)</span> <br> </td> <br><td> <br><span class="templink" tag="100102">宏碁(Acer)</span> <br> </td> <br><td> <br><span class="templink" tag="100103">华硕(ASUS)</span> <br> </td> <br><td> <br><span class="templink" tag="100104">戴尔(DELL)</span> <br> </td> <br><td> <br><span class="templink" tag="100105">苹果(Apple)</span> <br> </td> <br><td> <br><span class="templink" tag="100106">三星 (SAMSUNG)</span> <br> </td> <br> </tr> <br><tr id="linktype02"> <br><td style="width:100px"> <br><b>价格范围</b> <br> </td> <br><td> <br><span class="templinkactive" tag="0">不限</span> <br> </td> <br><td> <br><span class="templink" tag="100201">1000-2999</span> <br> </td> <br><td> <br><span class="templink" tag="100202">3000-3499</span> <br> </td> <br><td> <br><span class="templink" tag="100203">4000-4499</span> <br> </td> <br><td> <br><span class="templink" tag="100204">5000-5999</span> <br> </td> <br><td> <br><span class="templink" tag="100205">6000-6999</span> <br> </td> <br><td> <br><span class="templink" tag="100206">7000及以上</span> <br> </td> <br> </tr> <br><tr id="linktype03"> <br><td style="width:100px"> <br><b>尺寸范围</b> <br> </td> <br><td> <br><span class="templinkactive" tag="0">不限</span> <br> </td> <br><td> <br><span class="templink" tag="100301">8.9英寸及以下</span> <br> </td> <br><td> <br><span class="templink" tag="100302">11英寸</span> <br> </td> <br><td> <br><span class="templink" tag="100303">12英寸</span> <br> </td> <br><td> <br><span class="templink" tag="100304">13英寸</span> <br> </td> <br><td> <br><span class="templink" tag="100305">14英寸</span> <br> </td> <br><td> <br><span class="templink" tag="100306">15英寸及以上</span> <br><input type="hidden" id="Brand" value="0"> <br><input type="hidden" id="Price" value="0"> <br><input type="hidden" id="Size" value="0"> <br> </td> <br> </tr> <br> </table> <br> </div> <br> </form> <br> <br> <br> </div>