亚欧洲精品在线观看,窝窝影院午夜看片,久久国产成人午夜av影院宅,午夜91,免费国产人成网站,ts在线视频,欧美激情在线一区

php語(yǔ)言

PHP應(yīng)用:用XSLT輕松實(shí)現(xiàn)樹形折疊導(dǎo)航欄

時(shí)間:2025-03-02 11:02:29 php語(yǔ)言 我要投稿
  • 相關(guān)推薦

PHP應(yīng)用:用XSLT輕松實(shí)現(xiàn)樹形折疊導(dǎo)航欄

  每一發(fā)奮努力的背后,必有加倍的賞賜。以下百分網(wǎng)小編整理的用XSLT輕松實(shí)現(xiàn)樹形折疊導(dǎo)航欄的知識(shí),希望對(duì)大家有所幫助,更多信息請(qǐng)關(guān)注應(yīng)屆畢業(yè)生網(wǎng)!
  展開和折疊實(shí)在就是顯示或不顯示display:none or block)它與可見與不可見(visible or invisible)是有差別的, 前者不在頁(yè)面預(yù)留空間。 這個(gè)toggle函數(shù)完成兩個(gè)功效, 轉(zhuǎn)變TR本來(lái)的Hidden屬性, 使本來(lái)不顯示的顯示; 轉(zhuǎn)變IMG的src屬性, 更改圖片。
  toggle.js
  function toggle(id)
  {
  var thisRow = document.all.item(id);
  if (thisRow)
  {
  if (thisRow.getAttribute('Expanded') == 'yes')
  {
  thisRow.setAttribute('Expanded', 'no');
  thisRow.children(0).children(0).children(0).src = 'images/bs.gif';
  var allRows = document.all.tags('TR');
  for (var i=1; i < allRows.length; i )
  {
  var row = allRows[i];
  if (row.getAttribute('AncestorID') == id)
  {
  if (row.getAttribute('Expanded') == 'yes') {
  toggle(row.getAttribute('id'));
  }
  row.className = 'Navigator-Hidden';
  }
  }
  thisRow.className = 'Navigator';
  }
  else
  {
  thisRow.setAttribute('Expanded', 'yes');
  thisRow.children(0).children(0).children(0).src = 'images/bo.gif';
  var allRows = document.all.tags('TR');
  var depth = parseInt(thisRow.getAttribute('Depth'));
  for (var i=1; i < allRows.length; i )
  {
  var row = allRows[i];
  if (row.getAttribute('AncestorID') == id &&
  parseInt(row.getAttribute('Depth')) == depth 1 )
  {
  row.className = 'Navigator';
  }
  }
  }
  }
  }
  到此結(jié)束。
  誠(chéng)然這個(gè)TOC的功效還是最基礎(chǔ)的, 例如我還未做內(nèi)容和目錄的同步,其中有的處所還可以修正, 對(duì)xml和xsl文件可以進(jìn)一步瘦身。 不過(guò)對(duì)一般用戶來(lái)講, 這已經(jīng)足夠了。

【PHP應(yīng)用:用XSLT輕松實(shí)現(xiàn)樹形折疊導(dǎo)航欄】相關(guān)文章:

css就能實(shí)現(xiàn)簡(jiǎn)單導(dǎo)航欄實(shí)例08-15

PHP的樹形結(jié)構(gòu)算法07-06

如何制作簡(jiǎn)單導(dǎo)航欄03-27

php:樹形結(jié)構(gòu)的算法實(shí)例04-01

用PHP實(shí)現(xiàn)文件上傳二法05-10

php用cookie實(shí)現(xiàn)記住登錄狀態(tài)02-02

實(shí)現(xiàn)PHP實(shí)現(xiàn)限制IP訪問(wèn)02-23

PHP無(wú)限分類(樹形類)的深入分析05-12

PHP編程與應(yīng)用06-06