csdn和msdn怎么是一样的?

tingod 2003-03-24 05:18:35
咳,是单就左边导航栏的界面来讲的^^

感觉不错,大家知道哪儿有这种树形风格的代码吗?或者发给我,多谢。。。
tingodl@hotmail.com
...全文
120 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
luckycat 2003-05-01
  • 打赏
  • 举报
回复
前两天写了一个,全用JS做的!
Hodex 2003-05-01
  • 打赏
  • 举报
回复
<SCRIPT language=JavaScript>
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;

if (ver4) {
with (document) {
write("<STYLE TYPE='text/css'>");
if (NS4) {
write(".parent {position:absolute; visibility:visible}");
write(".child {position:absolute; visibility:visible}");
write(".regular {position:absolute; visibility:visible}")
}
else {
write(".child {display:none}")
}
write("</STYLE>");
}
}

function getIndex(el) {
ind = null;
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id == el) {
ind = i;
break;
}
}
return ind;
}

function arrange() {
nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.visibility != "hide") {
whichEl.pageY = nextY;
nextY += whichEl.document.height;
}
}
}

function initIt(){
if (!ver4) return;
if (NS4) {
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
}
arrange();
}
else {
divColl = document.all.tags("DIV");
for (i=0; i<divColl.length; i++) {
whichEl = divColl(i);
if (whichEl.className == "child") whichEl.style.display = "none";
}
}
}

function expandIt(el) {
if (!ver4) return;
if (IE4) {
whichEl = eval(el + "Child");
if (whichEl.style.display == "none") {
whichEl.style.display = "block";
}
else {
whichEl.style.display = "none";
}
}
else {
whichEl = eval("document." + el + "Child");
if (whichEl.visibility == "hide") {
whichEl.visibility = "show";
}
else {
whichEl.visibility = "hide";
}
arrange();
}
}
onload = initIt;
</SCRIPT>

<DIV class=parent id=KB1Parent>   <IMG
src="目录菜单站点导航.files/plus.gif" border=0>文件夹一</A></DIV>
<DIV class=child id=KB1Child> 
..
..
..
tingod 2003-03-24
  • 打赏
  • 举报
回复
哦哦哦哦。。this one?

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>

<xsl:template match="/Tree">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="TreeNode">
<div class="clsItem" type="leaf">
<xsl:choose>
<xsl:when test="@NodeImgSrc">
<img type="img"><xsl:attribute name="src"><xsl:value-of select="@NodeImgSrc" /></xsl:attribute></img></xsl:when>
<xsl:otherwise>
<span class="clsSpace" type="img"><span class="clsLeaf">.</span></span></xsl:otherwise>
</xsl:choose><span class="clsLabel" type="label">
<xsl:attribute name="id"><xsl:value-of select="@NodeId" /></xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="@Title" /></xsl:attribute>
<xsl:choose>
<xsl:when test="@Href">
<a>
<xsl:choose>
<xsl:when test="@Target">
<xsl:attribute name="target"><xsl:value-of select="@Target" /></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="target">fraContent</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:attribute name="tabindex">-1</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="@Href" /></xsl:attribute>
<xsl:value-of select="@Title" />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Title" />
</xsl:otherwise>
</xsl:choose>
</span>
</div>
</xsl:template>

<xsl:template match="TreeNode[* or @NodeXmlSrc]">
<div class="clsItem" type="parent">
<span class="clsSpace" type="img"><span class="clsCollapse">+</span></span><span class="clsLabel" type="label">
<xsl:attribute name="xmlsrc"><xsl:value-of select="@NodeXmlSrc" /></xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="@NodeId" /></xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="@Title" /></xsl:attribute>
<xsl:choose>
<xsl:when test="@Href">
<a>
<xsl:choose>
<xsl:when test="@Target">
<xsl:attribute name="target"><xsl:value-of select="@Target" /></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="target">fraContent</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:attribute name="tabindex">-1</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="@Href" /></xsl:attribute>
<xsl:value-of select="@Title" />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Title" />
</xsl:otherwise>
</xsl:choose>
</span>
<div class="hide" type="container"><xsl:apply-templates /></div>
</div>
</xsl:template>

<xsl:template match="@Target">
<xsl:copy><xsl:value-of /></xsl:copy>
</xsl:template>

<xsl:template match="/TreeNode">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="TreeNode/Tree">
<xsl:apply-templates />
</xsl:template>

</xsl:stylesheet>
老土豆T 2003-03-24
  • 打赏
  • 举报
回复
csdn用 了 msdn 的 xsl...

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧