分享好友 最新动态首页 最新动态分类 切换频道
GEM技术导航系统开心版源码.zip
2024-12-26 20:59
jQuery fontIconPicker ============== jQuery fontIconPicker is a small (`3.22KB` gzipped) jQuery plugin which allows you to include an elegant icon picker with categories, search and pagination inside your administration forms. The list of icons can be loaded manually using a `SELECT` field, an `Array` or `Object` of icons or directly from a Fontello `config.json` or IcoMoon `selection.json` file. Go to the [official plugin page](http://codeb.it/fonticonpicker) for examples and documentation. ![fontIconPickers](/demo/github-img.png) ## How it works Just include a copy of jQuery, the fontIconPickers script, the fontIconPickers theme and your Font Icons. Now you can trigger it on a `SELECT` or `INPUT[type="text"]` element. ### Include the JavaScript ```html <!-- jQuery --> <script type="text/javascript" src=https://download.csdn.net/download/m0_48462648/"jquery-1.7.1.min.js"></script> <!-- fontIconPicker JS --> <script type="text/javascript" src=https://download.csdn.net/download/m0_48462648/"jquery.fonticonpicker.min.js"></script> ``` ### Include the CSS ```html <!-- fontIconPicker core CSS --> <link rel="stylesheet" type="text/css" href=https://download.csdn.net/download/m0_48462648/"jquery.fonticonpicker.min.css" /> <!-- required default theme --> <link rel="stylesheet" type="text/css" href=https://download.csdn.net/download/m0_48462648/"themes/grey-theme/jquery.fonticonpicker.grey.min.css" /> <!-- optional themes --> <link rel="stylesheet" type="text/css" href=https://download.csdn.net/download/m0_48462648/"themes/dark-grey-theme/jquery.fonticonpicker.darkgrey.min.css" /> <link rel="stylesheet" type="text/css" href=https://download.csdn.net/download/m0_48462648/"themes/bootstrap-theme/jquery.fonticonpicker.bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href=https://download.csdn.net/download/m0_48462648/"themes/inverted-theme/jquery.fonticonpicker.inverted.min.css" /> ``` ### Include Font Icons ```html <!-- Font --> <link rel="stylesheet" type="text/css" href=https://download.csdn.net/download/m0_48462648/"fontello-7275ca86/css/fontello.css" /> <link rel="stylesheet" type="text/css" href=https://download.csdn.net/download/m0_48462648/"icomoon/icomoon.css" /> ``` ### Initialize with jQuery Finally call the fontIconPicker on a `SELECT` or `INPUT[type="text"]` element. ```html <!-- SELECT element --> <select id="myselect" name="myselect" class="myselect"> <option value="">No icon</option> <option>icon-user</option> <option>icon-search</option> <option>icon-right-dir</option> <option>icon-star</option> <option>icon-cancel</option> <option>icon-help-circled</option> <option>icon-info-circled</option> <option>icon-eye</option> <option>icon-tag</option> <option>icon-bookmark</option> <option>icon-heart</option> <option>icon-thumbs-down-alt</option> <option>icon-upload-cloud</option> <option>icon-phone-squared</option> <option>icon-cog</option> <option>icon-wrench</option> <option>icon-volume-down</option> <option>icon-down-dir</option> <option>icon-up-dir</option> <option>icon-left-dir</option> <option>icon-thumbs-up-alt</option> </select> <!-- JavaScript --> <script type="text/javascript"> // Make sure to fire only when the DOM is ready jQuery(document).ready(function($) { $('#myselect').fontIconPicker(); // Load with default options }); </script> ``` ```html <!-- INPUT element --> <input type="text" name="mytext" id="mytext" /> <script type="text/javascript"> jQuery(document).ready(function($) { $('#mytext').fontIconPicker({ source: ['icon-heart', 'icon-search', 'icon-user', 'icon-tag', 'icon-help'], emptyIcon: false, hasSearch: false }); }); </script> ``` ## Plugin Options Here's fontIconPicker options: ```js var $picker = $('.picker').fontIconPicker({ theme : 'fip-grey', // The CSS theme to use with this fontIconPicker. You can set different themes on multiple elements on the same page source : false, // Icons source (array|false|object) emptyIcon : true, // Empty icon should be shown? emptyIconValue : '', // The value of the empty icon, change if you select has something else, say "none" iconsPerPage : 20, // Number of icons per page hasSearch : true, // Is search enabled? searchSource : false, // Give a manual search values. If using attributes then for proper search feature we also need to pass icon names under the same order of source useAttribute : false, // Whether to use attribute selector for printing icons attributeName : 'data-icon', // HTML Attribute name convertToHex : true, // Whether or not to convert to hexadecimal for attribute value. If true then please pass decimal integer value to the source (or as value="" attribute of the select field) allCategoryText : 'From all categories', // The text for the select all category option unCategorizedText : 'Uncategorized' // The text for the select uncategorized option }); ``` ## Plugin APIs fontIconPicker provides three public APIs to manipulating the icon picker. ### setIcons( `Array|Object` newIcons, `Array|Object` iconSearch ) Use this method to dynamically change icons on the fly. `newIcons` and `iconSearch` (optional) have same datatypes as `source` and `searchSource` options. ```js $picker.setIcons(['icon-one', 'icon-two']); $picker.setIcons(['icon-one', 'icon-two'], ['Icon one will be searched by this', 'Icon two will be searched by this']); ``` ### destroyPicker() Use this to remove the icon picker and restore the original element. ```js $picker.destroyPicker(); ``` ### refreshPicker( `Object|Boolean` newOptions ) Refresh the icon picker from DOM or passed options. Useful when DOM has been changed or reinitializing after calling the destroy method or changing the options values. ```js $picker.refreshPicker({ theme: 'fip-bootstrap', hasSearch: false }); ``` Options and APIs are discussed in details with live examples at the project page. ### Important notes for local demo Only when loading demo locally: In firefox fontIconPicker icons won't be shown correctly because of CORS. For the same reason "Load icons from Fontello JSON config file" won't work on Chrome or IE 10. If you need to do some local testing you can disable strict_origin_policy at your risk. ## Browser Compatibility jQuery iconPicker has been successfully tested on: Firefox (edge), Safari (edge), Chrome (edge), IE8+ and Opera (edge). ## Credits jQuery fontIconPicker has been made by [me](http://codeb.it) & [swashata](https://github.com/swashata). You can contact me at micc83@gmail.com or [twitter](https://twitter.com/Micc1983) for any issue or feauture request.
最新文章
超逼真美女写真生成工具评测!教你玩转AI绘图神器
在这个数字化日益发展的时代,越来越多的人开始使用AI技术创造属于自己的艺术作品。特别是对于爱好摄影与美术的朋友们而言,能够通过AI生成超逼真的美女写真,无疑是一种崭新的体验与乐趣。想象一下,只需轻轻点击几下,你就能获得一幅栩栩
传统搜索争相“入局”,但AI搜索还不是一门好生意
“到 2026 年,传统搜索引擎的搜索量可能下降 25%。”今年2月,全球研究与咨询公司Gartner在一份报告中如此预测。随着生成式人工智能的发展,许多人的搜索习惯正在改变,AI搜索的发展正被按下加速键。用猎豹移动董事长兼CEO、猎户星空董事
规则引擎的实现
规则引擎是一种用于处理复杂业务规则的软件工具,它可以根据预先定义的规则来进行决策和处理。实现报警模块的规则引擎可以通过以下步骤进行:1. 定义规则:首先,需要明确需要触发报警的条件和规则。例如,当某个指标超过或低于某个阈值时
盐城考研培训机构最新排行榜名单出炉
一、招生规模:历史招生人数的多少表明了消费者对该项目信任的程度,所以该项目规模是一个重要指标,在一定程度上反映了该机构的实力。二、管理团队:管理团队是企业的命脉,考研辅导班的管理团队是一个重要的判断指标。现代企业要想更好的
网站外链规划:数量分析与优化策略
引言外链建设是搜索引擎优化 (SEO) 中至关重要的策略,因为它有助于建立网站的权威性和可信度。外链数量是衡量外链建设成功的一个关键指标,但是仅仅关注数量是不够的。为了取得优秀效果,需要制定一个全面的外链规划,该规划应包括对竞争
长安深蓝 sl07 智能驾驶辅助系统怎么样
长安深蓝 sl07 的智能驾驶辅助系统那是相当不错。在高速上,它的高速领航辅助功能能自动接管车辆,依照导航路线行驶,自行完成变道、超车、避让等操作,让长途驾驶轻松起来。城市道路中,城区巡航辅助功能厉害着呢,能精准识别交通信号灯,
财务报表都有哪些?怎么高效做好财务报表分析工作?
点击上方卡片,关注大数据分析与应用!
零基础轻松搭建个人网站账号指南
轻松搭建个人网站账号攻略,从零开始!只需注册域名、选择主机、安装CMS、配置网站、设计模板,即可轻松拥有自己的网站。本文详细介绍了每一步操作,助你快速上手!挑选适宜的网站构建平台注册个人网站账户挑选合适的域名配置网站服务器安
盘点世界各地的名表排行, 你拥有过几只?
盘点世界各地的手表排行。如果按照自己内心的想法进行排序,是会有无数种排名的,就算是百达翡丽排在末尾也毫不奇怪,但是如果从品牌的名气还有销售来排序的话,还是比较明确的。下面这些名表你拥有过几只?世界十大名表品牌,它们是:1,百
【国开·喜报】2025QCE高考放榜,最强战报重磅来袭!
国开中学国际部捷报Good news 悄然来临的毕业离别纵有百般不舍,但也让我们满心期待,因为同学们的耕耘有了收获。两年半的努力时光,让孩子们无数个坚定与希望中裹挟着彷徨焦躁的日日夜夜,有了明确的意义。 对于国开中学国际部2025届QCE毕
相关文章
推荐文章
发表评论
0评