|
楼主 |
发表于 2011-2-12 19:22:24
|
显示全部楼层
回复 35# myj
下面是分页部分的代码,- <span class="current">1</span>
-
-
-
-
-
- <a style="cursor:hand" onClick="doOrder('sale', 'desc', '2', '');">2</a>
-
-
-
-
- <a style="cursor:hand" onClick="doOrder('sale', 'desc', '3', '');">3</a>
-
-
-
-
- <a style="cursor:hand" onClick="doOrder('sale', 'desc', '4', '');">4</a>
-
-
-
-
- <a style="cursor:hand" onClick="doOrder('sale', 'desc', '5', '');">5</a>
-
-
-
-
- <a style="cursor:hand" onClick="doOrder('sale', 'desc', '6', '');">6</a>
-
-
-
-
- <a style="cursor:hand" onClick="doOrder('sale', 'desc', '7', '');">7</a>
-
-
-
-
- <a style="cursor:hand" onClick="doOrder('sale', 'desc', '49', '');">...49</a>
-
-
-
- <a style="cursor:hand" onClick="doOrder('sale', 'desc', '2', '');"> >> </a>
-
-
-
- </div>
- </div>
- <!--翻页效果结束-->
复制代码 可以知道都是触发了doOrder()函数,在源码里就可以找到这个函数,路下- //处理搜索按钮操作
- function doOrder(sort1, order, cur, browseWay) {
- //alert(browseWay)
- document.findLeeForm.sort.value = sort1;
- document.findLeeForm.order.value = order;
- if(cur !=null && cur !=''){
- document.findLeeForm.cur.value = cur;
- }
- if(browseWay == null || browseWay == ''){
- document.findLeeForm.browseWay.value = browseWay;
- document.getElementById("picturePart").style.display="none"; //图片版部分隐藏
- document.getElementById("photoPart").style.display="block"; //图文部分显示
- }else if(browseWay == 'picture'){ //图片版
- document.findLeeForm.browseWay.value = browseWay;
-
- document.getElementById("photoPart").style.display="none"; //图文版部分隐藏
- document.getElementById("picturePart").style.display="block"; //图片部分显示
- }
- document.findLeeForm.submit();
- }
复制代码 这个函数主要是提交了名字为findLeeForm的表单,传递4个参数sort1, order, cur, browseWay,以点第2页为例触发doOrder('sale', 'desc', '2', ''),这里可以知道sort1为sale,order代表排序desc降序,cur代表页码,browseWay是浏览模式,默认图文部分显示
findLeeForm的表单的源码- <form name="findLeeForm" action="yellowPageLee.do" method="post">
- <input type="hidden" name="searchFlg" value="leeSecondaryPage"/>
- <input type="hidden" name="flag" value="0"/>
- <input type="hidden" name="sort"/>//----------------sale
- <input type="hidden" name="order"/>------------------- desc
- <input name="class2" type="hidden" value=""/>
- <input name="merName" type="hidden" value=""/>
- <input name="merProducer" type="hidden" value=""/>
- <input name="merIssearchmer" type="hidden" value=""/>
- <input name="merAcclimation" type="hidden" value=""/>
- <input name="keyWord" type="hidden" value=""/>
- <input name="merIsprescription" type="hidden" value=""/>
- <input name="merSource" type="hidden" value=""/>
- <input name="merFrom" type="hidden" value=""/>
- <input name="cur" type="hidden"/>-------------2
- <input name="class1" type="hidden" value="177"/>---------分类id,177感冒药品
- <input name="browseWay" type="hidden"/>
- <input name="keywords" type="hidden" value=""/>
- </form>
复制代码 这样获得分页的地址就是- http://www.youjk.com/yellowPageLee.do?searchFlg=leeSecondaryPage&flag=0&sort=sale&order=desc&class2=&merName=&merProducer=&merIssearchmer=&merAcclimation=&keyWord=&merIsprescription=&merSource=&merFrom=&cur=页码&class1=177&browseWay=&keywords=
复制代码 这里主要就是cur,代表分页,路第49页就是http://www.youjk.com/yellowPageL ... eWay=&keywords= |
|