//此处在div中的ul是一个ztree树
var html='<div >'+ '<ul ></ul>'+ '</div>' $("body").append(html); //站点文本框点击事件 $btn.click(function () { var stationObj = $btn; var stationOffset = $btn.offset(); $("#"+btnName+"DropDown").css({left:stationOffset.left + "px", top:stationOffset.top + stationObj.outerHeight() + "px"}).slideDown("fast"); });   //站点选择失去焦点 $("body").bind("mousedown", function(event){ if (!(event.target.id == btnName || event.target.id == btnName+"DropDown" || $(event.target).parents("#"+btnName+"DropDown").length>0)) { $("#"+btnName+"DropDown").fadeOut("fast"); } } );

 

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2021-12-14
  • 2021-12-04
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-14
  • 2021-12-04
  • 2021-12-04
  • 2021-12-10
  • 2021-12-14
  • 2021-12-04
  • 2021-12-04
相关资源
相似解决方案