js 菜菜鸟问几个js的问题

alphagx alphagx 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
谁能帮我解释一下这个函数呢??
对js 不是很了解
谢谢了。。

function AddGroup(strName, strUrl)
{
var objGroup = document.createElement("DIV");
var objTitle = document.createElement("DIV");
var objContent = document.createElement("DIV");
var objTopices = document.createElement("TABLE");
var objTopicesBody = document.createElement("TBODY");
var objTopicToolTip = document.createElement("DIV");

objGroup.className = "listGroup";
objContent.className = "listContent";
objTopices.className = "listTopices";
objTopicToolTip.className = "topicToolTip";
objContent.style.display = "none";
objContent.setAttribute("loaded", false);
objContent.setAttribute("page", 1);

titleHTMLString = "<table class=listTitle border=0><tr>";
titleHTMLString += "<td class=datactrl width=20 url=" + strUrl + " forumid=" + forumID + ">";
titleHTMLString += "<img id=" + idGroupIcon + " class=listGroupIcon border=0 width=16 height=15 align=absmiddle src=" + ImgGroupCollapse + "></img></td>";
/* lee1892 */
//titleHTMLString += "<td class=listTitleLink><a target='_blank' href=" + strUrl + ">" + strName + "</a><font id=" + idPageNum + " class=listPageNum></font></td>";
titleHTMLString += "<td class=listTitleLink><a id=" + idGroupAnchor + " title=" + IDS_LISTICON + " href='#'>" + strName + "</a><font id=" + idPageNum + " class=listPageNum></font></td>";
/* end */
titleHTMLString += "<td class=listIndicator id=" + idIndicator + "></td>";
titleHTMLString += "</tr></table>";



objTitle.innerHTML = titleHTMLString;
objTitle.style.paddingLeft = "5px";

objTopices.appendChild(objTopicesBody);
objContent.appendChild(objTopices);

objGroup.appendChild(objTitle); /*增加三个子元素*/
objGroup.appendChild(objContent);
objGroup.appendChild(objTopicToolTip);

var objIndicator = objTitle.all(idIndicator);
CreateIndicator(objIndicator);
CreateToolTip(objTopicToolTip);

var objGroupIcon = objTitle.all(idGroupIcon);
if (objGroupIcon != null)
{
//objGroupIcon.addBehavior(datacontroller);
objGroupIcon.onclick = DownloadFirstPage;
}
/* lee1892 */
var objGroupAnchor = objTitle.all(idGroupAnchor);
if (objGroupAnchor != null)
{
objGroupAnchor.onclick = function()
{
openInBrowser(strUrl);
}
}
/* end */
element.appendChild(objGroup);
countTopics ++;

}

...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
alphagx
JavaScript 87,983 成员 224,681 内容