[英]How to create a pop up when I click on any item of this tree
I want to show a div when I click on any item of the tree here 我想说明一个div当我在树的任何项目点击这里
the tree is loaded in the index.html via this iframe 通过该iframe将树加载到index.html中
<IFRAME NAME="treeframe" ID="treeframe" SRC="tree.htm?150921" CLASS="fullsize" FRAMEBORDER="0" SCROLLING="no"></IFRAME>
the element ('.di') is generated with js 元素('.di')是用js生成的
var v = document.createElement("div");
v.className = "di";
var s = v.style;
s.width = sz.Tew + "px";
s.height = sh + "px";
s.left = (sx - (sz.Tew / 2)) + "px";
s.top = (sy - (sh / 2)) + "px";
if (wp) {
v.onmousedown = TCT;
v.id = i;
v.pid = e.p.i;
o.ps[i] = {
x: sx,
y: sy
};
}
var tn = e.p.hp ? (mn ? fn : (e.p.h + (sn ? (" " + sn) : ""))) : e.p.h;
v.innerHTML = "<TABLE WIDTH=\"100%\" HEIGHT=\"100%\" STYLE=\"table-layout:fixed;\">" + "<TR><TD CLASS=\"" + cc + "\" STYLE=\"font-size:" + (e.d ? sz.Tds : sz.Tfs) + "px;color:" + _4 + "\"" + " TITLE=\"" + (e.d ? "Duplicate: " : "") + EH(fn) + "\">" + (e.d ? "<I>Duplicate:</I><BR>" : "") + (e.m ? "<B>" : "") + EL(tn) + (e.m ? "</B>" : "") + "</TD></TR>" + rs + "</TABLE>";
o.appendChild(v);
I typed this code but it's not working: 我输入了此代码,但无法正常工作:
jQuery(window).load( function(){
jQuery('.di').on( 'click', function ( _ev ) {
jQuery('.sidebar-wrapper').fadeIn(500);
});
jQuery('.sidebar-wrapper .sidebar-close').on( 'click', function ( _ev ) {
jQuery('.sidebar-wrapper').fadeOut(500);
});
});
jQuery(document).ready( function(){
jQuery('body').on( 'click','.dcelld', function ( _ev ) {
jQuery('.sidebar-wrapper').fadeIn(500);
});
jQuery('body').on( 'click','.sidebar-wrapper .sidebar-close', function ( _ev ) {
jQuery('.sidebar-wrapper').fadeOut(500);
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.