日期:2014-05-16 浏览次数:20346 次
for(i = 0; i < folder.contents.length; i++) { if(folder.contents[i].is_dir == true) { var folderItem = $("<h4>"); var folderIcon = $("<img>"); var folderLink = $("<a>"); folderLink.value = folder.contents[i].path; folderLink.bind('click', function() { //function1 }); folderItem.append(folderIcon); folderItem.append(folderLink); folderItem.bind('click', function() { //function2 }); } }
folderItem.append(folderIcon).append(folderLink).bind('click', function() { $(this).find("a").click(); });
------解决方案--------------------