سلام به همه...
من میخوام وقتی صفحه لود میشه treeviwe که دارم expend باشه ,
با jquery چطور میشه استفاده کنم؟
از چه پلاگینی استفاده کردید ؟
در مستندات باید راجب این موضوع توضیح داده باشه
کد js این هستش//
$.fn.extend({ treeview: function () { return this.each(function () { // Initialize the top levels; var tree = $(this); tree.addClass('treeview-tree'); tree.find('li').each(function () { var stick = $(this); }); tree.find('li').has("ul").each(function () { var branch = $(this); //li with children ul branch.prepend("<i class='tree-indicator fa fa-plus-square-o'></i>"); branch.addClass('tree-branch'); branch.on('click', function (e) { if (this == e.target) { var icon = $(this).children('i:first'); icon.toggleClass("fa fa-minus-square-o fa fa-plus-square-o"); $(this).children().children().toggle(); } }) branch.children().children().toggle(); /** * The following snippet of code enables the treeview to * function when a button, indicator or anchor is clicked. * * It also prevents the default function of an anchor and * a button from firing. */ branch.children('.tree-indicator, button, a').click(function (e) { branch.click(); e.preventDefault(); }); }); }); } }); /** * The following snippet of code automatically converst * any '.treeview' DOM elements into a treeview component. */ $(window).on('load', function () { $('.treeview').each(function () { var tree = $(this); tree.treeview(); }) })
از کجا دانلود کردید ؟
لینکش را قرار دهید
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)