listbox.js
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Listbox.js is a simple jQuery plugin that provides a more powerful alternative to the standard ``` tag. The main problem of ```` tag and creates an alternative to the last one based on ``
`` tags. It opens up great possibilities for customization. In addition, this component provides the search bar which would be useful in lists with a lot of items. This component was born special for XSnippet_ project. **NOTE:** This is my first JavaScript code. So don't judge strictly. Usage ----- Link the component and a stylesheet from your page. .. code:: html Create Listbox object. .. code:: html Customization ------------- Listbox.js uses following ``CSS`` classes. .. code:: css .lbjs {} /*
: component container */ .lbjs-list {} /*
: container for list items */ .lbjs-item {} /*
: list item */ .lbjs-item:not([disabled]) {} /*
: enabled list item */ .lbjs-item[disabled] {} /*
: disabled list item */ .lbjs-item[selected] {} /*
: selected list item */ .lbjs-searchbar {} /* : search query input */ FAQ --- - **How to bind event handler to the `click` list item event?** Because of Listbox.js dynamically changes DOM you should use jQuery's ``live()`` method: .. code:: js $('.myListboxClass .lbjs-item').live('click', function() { alert($(this).html()); }); - **How to make disabled item?** The process is similar to making disabled items in the ``