treeNode.iconSkin.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <div class="apiDetail">
  2. <div>
  3. <h2><span>String</span><span class="path">treeNode.</span>iconSkin</h2>
  4. <h3>Overview<span class="h3_info">[ depends on <span
  5. class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
  6. <div class="desc">
  7. <p></p>
  8. <div class="longdesc">
  9. <p>The className of node's custom icon.</p>
  10. <p class="highlight_red">1. You need to modify the css, add the definition of className.</p>
  11. <p class="highlight_red">2. The css is simple, convenient, and support the parent node to switch icons
  12. when it is expanded or collapsed.</p>
  13. <p class="highlight_red">3. Recommend the use of CSS Sprites, can reduce repeating load the image, to
  14. avoid image flicker.</p>
  15. <p class="highlight_red">4. The 'iconSkin' support IE6 in zTree v3.x.</p>
  16. <p class="highlight_red">5. If you need to use image's URL to set the custom icon, please set the
  17. 'treeNode.icon' or 'treeNode.iconOpen' or 'treeNode.iconClose' attribute.</p>
  18. <p>Default: undefined</p>
  19. </div>
  20. </div>
  21. <h3>String Format</h3>
  22. <div class="desc">
  23. <p>The string about custom icon's className.</p>
  24. </div>
  25. <h3>Examples of css & treeNode</h3>
  26. <h4>1. Set the custom icon</h4>
  27. <pre xmlns=""><code>css example:
  28. .ztree li span.button.diy01_ico_open, .ztree li span.button.diy01_ico_close{...}
  29. .ztree li span.button.diy02_ico_open{...}
  30. .ztree li span.button.diy02_ico_close{...}
  31. .ztree li span.button.diy03_ico_docu{...}
  32. node's data example:
  33. var nodes = [
  34. //Only show one icon when it is expanded or collapsed.
  35. { name:"Parent Node 1", iconSkin:"diy01"},
  36. //Show two icons when it is expanded or collapsed.
  37. { name:"Parent Node 2", iconSkin:"diy02"},
  38. //the custom icon for leaf node
  39. { name:"Leaf Node", iconSkin:"diy03"}
  40. ]</code></pre>
  41. </div>
  42. </div>