项目作者: ange007

项目描述 :
JQuery HTML form styling plugin.
高级语言: CSS
项目地址: git://github.com/ange007/JQueryFormStyler-Modern.git
创建时间: 2015-12-10T13:10:09Z
项目社区:https://github.com/ange007/JQueryFormStyler-Modern

开源协议:Other

下载


jQuery FormStyler Modern 2.x

Latest Stable Version
Total Downloads
License
Build Status

Самостоятельное ответвление от плагина jQueryFormStyler

jQuery FormStyler Modern

Info

JQuery HTML form styling and modernization plugin:

  • <input type="checkbox">
  • <input type="radio">
  • <input type="file">
  • <input type="number">
  • <input type="password"> (styling and show/hide password button)
  • <select> (styling and function for search on server by AJAX requests)
  • <input type="range">, <textarea>, <button> and other (styling only with CSS)

Attention!

Settings from plugin vesion 2.x - differ from version 1.x.

Структура настроек плагина версии 2.x - отличаются от настроек оригинального и версии 1.x данного плагина.

Install

Composer:

  1. $ php composer.phar require "ange007/jquery-formstyler-modern"

NPM:

  1. $ npm i jquery.formstyler-modern

Getting Started

Main plugin file - jquery.formStylerModern.js.
Connection of styles is possible in two ways:

  • jquery.formStylerModern.css (frame and default style)
  • Frame file - /style/jquery.formStylerModern.frame.css and style file - /style/jquery.formStylerModern.(default|bootstrap|etc).css

Works

Stylish elements.

  1. $( 'input, select, button' ).styler(
  2. {
  3. locale: 'ru',
  4. select: {
  5. search: {
  6. limit: 10
  7. }
  8. },
  9. onFormStyled: function( )
  10. {
  11. ...
  12. }
  13. } );

Reload plugin with certain settings.

  1. $( '#checkbox-indeterminate-change' ).styler( 'reinitialize', { checkbox: { indeterminate: true } } );

Clean style.

  1. $( 'input, select, button' ).styler( 'destroy' );

Repaint after “manual” change.

  1. $( this ).prop( 'disabled', true )
  2. .trigger( 'repaint' );

Search from server.

  1. $( '#search' ).styler( 'reinitialize', {
  2. select: {
  3. search: {
  4. ajax: {
  5. delay: 250,
  6. cache: true,
  7. url: 'https://api.github.com/search/repositories',
  8. data: function( params ) {
  9. return {
  10. q: params.term,
  11. page: params.page
  12. };
  13. },
  14. processResults: function( data, params )
  15. {
  16. var items = [ ];
  17. $( data.items ).each( function( index, value )
  18. {
  19. items.push( { 'value': value.html_url,
  20. 'caption': value.owner.login + '/' + value.name } );
  21. } );
  22. return {
  23. items: items
  24. };
  25. }
  26. }
  27. }
  28. }
  29. } );