男人吃奶摸下挵进去好爽,日日躁夜夜躁狠狠躁,freesexvide0s性欧美高清,高清freexxxx性国产,无码人妻一区二区三区一,乱人伦中文字幕成人网站在线,亚洲欧美综合一区二区三区 ,神马影院在线视频观看
知識(shí)學(xué)堂
  • ·聯(lián)系電話:+86.023-75585550
  • ·聯(lián)系傳真:+86.023-75585550
  • ·24小時(shí)手機(jī):13896886023
  • ·QQ 咨 詢:361652718 513960520
當(dāng)前位置 > 首頁 > 知識(shí)學(xué)堂 > 網(wǎng)站建設(shè)知識(shí)
ASP實(shí)例教程:asp無限級(jí)顯示分類代碼
更新時(shí)間:2011-12-30 | 發(fā)布人:本站 | 點(diǎn)擊率:817
為了方便使用分類,我定義了一個(gè)分類表category,里面字段是
id(自動(dòng)編號(hào))  cat_name(分類名) parent_id(父ID,對(duì)應(yīng)本表ID) cat_order(順序) is_show(是否顯示)  u_id(這個(gè)用來區(qū)別是新聞分類,還是產(chǎn)品分類,還是其他分類),為了方便,我將這些分類全部放在這張表中。
在給客戶添加分類的時(shí)候,結(jié)果有太多的分類,本來前臺(tái)顯示的時(shí)候,將它們?nèi)匡@示出來了,好長。客戶提出修改意見,要求將它們改成點(diǎn)擊大分類,才可以將其子分類顯示出來,并且每個(gè)分類下面還有一條虛線,并且大分類前面有個(gè)圖片加號(hào),展開后要變成減號(hào)。
<script>
function fd(id,num)
{
 t=$("c"+id+"_1").style.display;
 
 if(t=="none")
 {
   t1="block";
   t2="images/fll_34.gif";
 }
 else
 {
  t1="none"; 
  t2="images/fll_34.gif";
 }
 for(i=1;i<=num;i++)
 {
  $("c"+id+"_"+i).style.display=t1;
  $("d_"+id).src=t2;  
 }
}
function $(id)
{
 return document.getElementById(id);
}
</script>
這是asp無限級(jí)顯示分類代碼,并給這些分類加上id

<%
'功能:asp無限級(jí)顯示分類+js顯示與隱藏
'參數(shù):parent_id為父ID,stype為新聞,產(chǎn)品,文章大分類
'原創(chuàng)文章,轉(zhuǎn)載請(qǐng)保留些信息,謝謝
function cat111(parent_id,stype)
set rs1 =server.createobject("adodb.recordset")
sql="select cat_name,cat_id,parent_id from category where parent_id="&parent_id&" and u_id="&stype&" and is_show=1 order by cat_order asc"
set rs1=conn.execute(sql)
If rs1.eof Then
Else 
if(depath>2) then
 display2="none"     
else
 display2="block" 
end if  
dim j
j=1
do while not rs1.eof 
 cat_name1 = rs1("cat_name")
 cat_id1 = rs1("cat_id")  
 parent_id1=rs1("parent_id") 
 '******************下面是你要顯示的******************' 
 m9=0
 sql2="select count(cat_id) as t from category where parent_id="&cat_id1&" and u_id="&stype&""    
 set rs2=server.createobject("adodb.recordset")
 set rs2=conn.execute(sql2) 
 if not rs2.eof then
    m9=rs2("t")
 else
  m9=0  
 end if 
 rs2.close
  
 if(depath<=2) then  
  mgif="images/-.gif"
  a="block"
 else
  if(m9>0) then 
  mgif="images/+.gif" 
  else
  mgif="images/-.gif"
  end if
  if(depath=4) then
   a="block"
  else  
   a="none"
  end if
 end if  
 
 
 catstr=catstr & "<tr id=""c"&parent_id&"_"&j&""" style=""display:"&a&"""><td width=""25"" align=""center"" valign=""middle"" class=""dotted_class""><img src="""&mgif&""" width=""12"" height=""11"" id=""d_"&cat_id1&"""></td><td class=""dotted_class leftcatcss"">"
 if(m9>0) then
  catstr=catstr&"<a href=""javascript:void(0);"" _fcksavedurl="""javascript:void(0);""" _fcksavedurl="""javascript:void(0);""" onclick=""fd("&cat_id1&","&m9&")"">" &vbnewline
 else
  catstr=catstr&"<a href=""products.asp?id="&cat_id1&""" target=""_blank"">"&vbnewline
 end if
 for i=1 to depath
   catstr=catstr&"&nbsp;"
 Next
 catstr=catstr&cat_name1&"</a></td></tr>"&vbnewline
 m9=0
     
 sql2="select cat_name,cat_id from category where parent_id="&parent_id1&" and u_id="&stype&" order by cat_order asc"    
 set rs2=server.createobject("adodb.recordset")
 set rs2=conn.execute(sql2)
 if not rs2.eof then
    depath=depath+4 
    call cat111(cat_id1,stype)
 end if
 rs2.close 
 set rs2=nothing 
 depath=depath-4 
 '******************上面是你要顯示的******************'
 j=j+1
rs1.movenext
loop
End If
rs1.close
set rs1=nothing
end Function
%>
在使用這個(gè)函數(shù)之前加上
catstr=""
然后再call,下面的虛線加在css中的dotted_class里面,這樣就搞定了。
注意:這里得到的是一個(gè)表格的行,要和其他行放在一起,不要加到td里面去了。
分享到: QQ空間 新浪微博 開心網(wǎng) 人人網(wǎng)
主站蜘蛛池模板: 亚洲精品无amm毛片| 野花日本韩国视频免费8| 国产区精品系列在线观看| 国产欧美精品另类又又久久| 99riav国产精品视频| 国内精品久久久久国产盗摄| 一二三四视频高清在线观看3| 国精产品999国精产| 丰满少妇被猛烈进入在线播放| 国产午夜精品一区二区三区不卡| 国产乱子伦真实| 色偷偷av一区二区三区| 日韩综合夜夜香内射| 亚洲 自拍 另类 欧美 综合| 成人精品视频99在线观看免费| 两个人的免费视频完整版| 无码囯产精品一区二区免费| 最近中文字幕2019免费| 国产日产欧产美| 亚洲色偷偷av| 丰满的已婚女人hd中字 | 免费免费啪视频观看视频| 久久无码人妻精品一区二区三区| 忘忧草www日本韩国| 亚洲成av人片一区二区| 精品 综合 国产| 永久免费无码av在线网站| 欧美老肥妇做爰bbww| jzzijzzij亚洲成熟少妇| 欧美v国产v亚洲v日韩九九| 星空影院电影在线看| 爱如潮水在线观看视频| 亚洲精品av一区二区黑人 | 欧美日韩国产三级一区二区三区| av无码久久久久不卡蜜桃| 天堂网www中文在线| 三级4级全黄| 中文成人无字幕乱码精品区| 伦子系列午睡沙发| 丁香花在线| 中国老头和老妇tube|