LuenCC / JS

js hints and hacks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS

js hints and hacks

onload-event.js

Little script for run event after all images loaded.

jquery.creditСardFormat.js

jQuery plugin for checking input field by Credit Card Format like [xxxx-xxxx-xxxx-xxxx], which add and delete hyphen.

2 unnecessary options:

  • positionArray - array of hyphen after specified numeral
  • lengthArray length of credit card number without hyphen

By default:

positionArray : [4, 8, 12]
lengthArray   : 16  

Call:

$('input').creditСardFormat();

jquery.currencyFormat.js

jQuery plugin for making Currency field with "$" and commas like: $12,345.
It is wrapping input in <div> and adding hidden input with same name (for sending to server just a number).

Call:

$('input').currencyFormat();

ellipsis.js

jQuery plugin for cutting text and adding ellipsis at the end.
Require DIV with "overflow: hidden" style and fixed height and tag P inside.

Call:

$('.ellipsis').addEllipsis();

jquery.popup.js

jQuery plugin for creating popup near element target: by showing hidden popup or loading by ajax.
Use:
[data-popup-link='name'] - use for target with name as identifier
[data-popup-content='name'] - popup content, be default should be hidden
[data-popup-url='url'] - set url for ajax or 'href'
[data-popup-close='name'] - add close button on popup

Call:

$('[data-popup-link]').popup();

About

js hints and hacks

License:MIT License


Languages

Language:JavaScript 100.0%