Giter Club home page Giter Club logo

fortunewheel's Introduction

fortunewheel

jQuery plugin for creating "Wheel of Fortune" styled input texts (separating chars)

Example For Use:

$(document).ready(function(){
	$("input.wof").fortuneWheel({
		/*
		//Optional values and their defaults
		placeholder: null, 					// The element to put the characters in
		pattern: [], 						// The pattern of the text - can also be provided using data-pattern on the element
		hideElem: true, 					// Hide the original element
		wordSpace: 15, 						// Space between words in pixels (uses margin)
		spaceClass: "word-space",			// Class added to the last char in every word (except the last word)
		showCaretSymbol: false, 			// Whether to show the caret symbol on the char focused
		allowBlanks: true,					// If falsy - no char is allowed to be empty in the middle
		blurOnLastChar: false, 				// Whether to blur out of the last characters when it is filled with value
		placeholderClass: 'fortune-wheel',	// class added to the characters holder
		eventFull: 'change-full', 			// name for event triggered (after change) when the pattern is full
		eventNotFull: 'change-not-full', 	// name for event triggered (after change) when the pattern is not full yet
		allowNumbers: false, 				// Whether to allow numbers input (doesn't work well when in RTL)
		trimValue: true, 					// Whether to trim the result when it is returned
		filledClass: 'filled', 				// A class added to input when it is fill
		*/
		//restrict: "א-תa-zA-Z",				// Regular expression's set of characthers allowed to be entered
		byWords: true,						// Split the pattern to words instead of chars
		full: function(val){ 				// Callback when full
			$("#result_demo").text("Full: "+val);
		},
		partial: function(val){ 			//callback when change partially
			$("#result_demo").text("NOT FULL");
		}
	});
});

When the HTML is:

<input type="text" class="wof" data-pattern="[2,3,2]" />
<div id="result_demo"></div>

In order to destroy the plugin from a specific input you can call

$("input.wof").fortuneWheel("destroy")

fortunewheel's People

Contributors

yaronuliel avatar

Stargazers

Sabuj Kundu avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.