男人吃奶摸下挵进去好爽,日日躁夜夜躁狠狠躁,freesexvide0s性欧美高清,高清freexxxx性国产,无码人妻一区二区三区一,乱人伦中文字幕成人网站在线,亚洲欧美综合一区二区三区 ,神马影院在线视频观看
知識學堂
  • ·聯系電話:+86.023-75585550
  • ·聯系傳真:+86.023-75585550
  • ·24小時手機:13896886023
  • ·QQ 咨 詢:361652718 513960520
當前位置 > 首頁 > 知識學堂 > 網站建設知識
ASP實例教程:asp無限級顯示分類代碼
更新時間:2011-12-30 | 發布人:本站 | 點擊率:816
為了方便使用分類,我定義了一個分類表category,里面字段是
id(自動編號)  cat_name(分類名) parent_id(父ID,對應本表ID) cat_order(順序) is_show(是否顯示)  u_id(這個用來區別是新聞分類,還是產品分類,還是其他分類),為了方便,我將這些分類全部放在這張表中。
在給客戶添加分類的時候,結果有太多的分類,本來前臺顯示的時候,將它們全部顯示出來了,好長。客戶提出修改意見,要求將它們改成點擊大分類,才可以將其子分類顯示出來,并且每個分類下面還有一條虛線,并且大分類前面有個圖片加號,展開后要變成減號。
<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無限級顯示分類代碼,并給這些分類加上id

<%
'功能:asp無限級顯示分類+js顯示與隱藏
'參數:parent_id為父ID,stype為新聞,產品,文章大分類
'原創文章,轉載請保留些信息,謝謝
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
%>
在使用這個函數之前加上
catstr=""
然后再call,下面的虛線加在css中的dotted_class里面,這樣就搞定了。
注意:這里得到的是一個表格的行,要和其他行放在一起,不要加到td里面去了。
分享到: QQ空間 新浪微博 開心網 人人網
主站蜘蛛池模板: 娇妻玩4p被三个男人伺候| 国产无吗一区二区三区在线欢| 欧美va久久久噜噜噜久久| 亚洲精品无码永久在线观看性色 | 玩弄人妻少妇精品视频| 两个人的视频全免费观看在线| 日日摸天天摸爽爽狠狠97| 欧美成人看片一区二三区图文| 亚洲+欧美+视频| 内射少妇一区27p| 国产乱码一区二区三区爽爽爽| 欧洲熟妇色xxxx欧美老妇多毛网站 | 国产成人精品久久一区二区三区 | 日本护士体内she精2╳╳╳| 野花韩国高清免费神马| 果冻传媒一二三区艾秋| 我和亲妺妺乱的性视频| 午夜无码片在线观看影院| 色爱区综合五月激情| 亚洲日产欧| 日本特黄a级高清免费大片| 综合一区无套内射中文字幕| 野花高清在线观看免费全集7| 麻豆视传媒精品av| 国产精品18久久久久久不卡| 果冻传媒2021精品一区| 高清免费卡一卡二新区| 99久久国产综合精品成人影院| 大地资源二在线视频观看| 好姑娘免费中文在线观看 | 热の无码热の有码热の综合| 破了亲妺妺的处免费视频国产| 成人精品视频一区二区| 一本大道av伊人久久综合| 丰满少妇高潮惨叫正在播放| 末发育娇小性色xxxxx| 青草青草久热精品视频在线观看| 久久国产精品偷| 精国产品一区二区三区a片| 亚洲欧美中文字幕5发布| 老子影院午夜精品无码|