複製代碼代碼如下: 複製代碼代碼如下: > 複製程式碼程式碼如下: <br> var zTree1;<br> var setting = {<br> isSimpleData: true,<br> treeNodeKey: "id",<br> treeNodeParentKey: "pId",<br> fontCss: setFont,<br> callback: {<br> beforeClick: zTreeOnBeforeClick,<br> click: zTreeOnClick<br> } <br> };<br> var zNodes = [<br> {id:1, pId:0, name:"北京"},<br> {id:2, pId:0, name:"天津"},<br> {id:3, pId:0, name:"上海"},<br> {id:6, pId:0, name:"重庆"},<br> {id:4, pId:0, name:"河北省", open:true},<br> {id:41, pId:4, name:"石家庄"},<br> {id:42, pId:4, name:"保定"},<br> {id:43, pId:4, name:"邯郸"},<br> {id:44, pId:4, name:"承德"},<br> {id:5, pId:0, name:"广东省", open:true},<br> {id:51, pId:5, name:"广州"},<br> {id:52, pId:5, name:"深圳"},<br> {id:53, pId:5, name:"东莞"},<br> {id:54, pId:5, name:"佛山"},<br> {id:6, pId:0, name:"福建省", open:true},<br> {id:61, pId:6, name:"福州"},<br> {id:62, pId:6, name:"厦门"},<br> {id:63, pId:6, name:"泉州"},<br> {id:64, pId:6, name:"三明"}<br> ];<br> <p> function setFont(treeId, treeNode) {<br> if (treeNode && treeNode.isParent) {<br> else {<br> return null;<br> }<br> }<br> function showMenu(){<br> var cityObj = $("#citySel");<ff> $( "#DropdownMenuBackground").css({left:cityOffset.left "px",top:cityOffset.top cityObj.outerHeight() "px"}).slideDown("fast"); <br> } <br> function reloadTree(){<br> hideMe }<br> function hideMenu() {<br> $("#DropdownMenuBackground").fadeOut("fast");<br> }<br> Node.isParent);<br> if (!check)alert("只能選擇城市...");<br> return check;<br> if (treeNode) {<br> var cityObj = $("#citySel");<br> hideMenu();<br> }<br> } <br><br> $(document).ready(function(e) {<br> reloadTree();<br> function(){<br> if($("#DropdownMenuBackground").css("display") == "無"){<br> showMenu();<br> }<br> else {<br> hideMenu();<br> }<br> }<br> );<br> <br> if (!(event.target.id == "D羅pdown選單背景” || $(event.target).parents("#DropdownMenuBackground").length>0)) {<br> 🎜> }); <br> });<br><br><br><br></ff></p> </div> </div>