Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
jquery-asRange
Advanced tools
A jquery plugin for convent input into range slider.
dist/
├── jquery-asRange.js
├── jquery-asRange.es.js
├── jquery-asRange.min.js
└── css/
├── asRange.css
└── asRange.min.css
Several quick start options are available:
bower install jquery-asRange --save
npm install jquery-asRange --save
yarn add jquery-asRange
If you want build from source:
git clone git@github.com:amazingSurge/jquery-asRange.git
cd jquery-asRange
npm install
npm install -g gulp-cli babel-cli
gulp build
Done!
jquery-asRange
requires the latest version of jQuery
.
<link rel="stylesheet" href="/path/to/asRange.css">
<script src="/path/to/jquery.js"></script>
<script src="/path/to/jquery-asRange.js"></script>
<input class="example" type="range" min="0" max="10" name="points" step="0.01" />
All you need to do is call the plugin on the element:
jQuery(function($) {
$('.example').asRange();
});
There are some example usages that you can look at to get started. They can be found in the examples folder.
jquery-asRange
can accept an options object to alter the way it behaves. You can see the default options by call $.asRange.setDefaults()
. The structure of an options object is as follows:
{
namespace: 'asRange',
skin: null,
max: 100,
min: 0,
value: null,
step: 10,
limit: true,
range: false,
direction: 'h', // 'v' or 'h'
keyboard: true,
replaceFirst: false, // false, 'inherit', {'inherit': 'default'}
tip: true,
scale: true,
format(value) {
return value;
}
}
Property | Default | Description |
---|---|---|
namespace | "range" | Optional property, set a namspace for css class, for example, we have .range_active class for active effect, if namespace set to 'as-range', then it will be .as-range_active |
skin | null | Compulsory property, set transition effect, it works after you load specified skin file |
max | 100 | Optional property, set the maximum range value of the progress bar |
min | 0 | Optional property, set the initial value of the progress bar |
value | [0,20] | Optional property, set the pointer to the initial position |
step | 10 | Optional property, set up the moving step at a time |
pointer | 2 | Optional property, set the number of pointer |
limit | true | Optional property, if true, limit the range of the pointer moving |
orientation | 'v' | Optional property, set the direction for the progress bar ,'v' for vertical and 'h' for horizontal |
tip | true | Optional property, if true, the component of tip will display and follow the pointer |
scale | Object | Optional property, values means the value you want to add to scale; gap means how many parts you want to division between value; grid means how many small parts in the part |
format | function(value) {return value;} | Optional property, a function of formatting output |
onChange | function(instance) {} | Optional property, according to your need, it can be as a function of the extended interface |
callback | function() {} | Optional property, if it's a funciton, will be called when mouseup |
Methods are called on asRange instances through the asRange method itself. You can also save the instances to variable for further use.
// call directly
$().asRange('destroy');
// or
var api = $().data('asRange');
api.destroy();
Set the range if value is defined or get the value.
// set the val
$().asRange('val', '5');
// get the val
var value = $().asRange('val');
Set the range value
$().asRange('set', '5');
Get the range value.
var value = $().asRange('get');
Enable the range functions.
$().asRange('enable');
Disable the range functions.
$().asRange('disable');
Destroy the range instance.
$().asRange('destroy');
jquery-asRange
provides custom events for the plugin’s unique actions.
$('.the-element').on('asRange::ready', function (e) {
// on instance ready
});
Event | Description |
---|---|
init | Fires when the instance is setup for the first time. |
ready | Fires when the instance is ready for API use. |
enable | Fires immediately when the enable instance method has been called. |
disable | Fires immediately when the disable instance method has been called. |
change | Fires when the position of pointer is changed |
end | Fires when mouse up |
destroy | Fires when an instance is destroyed. |
If you have to use other plugin with the same namespace, just call the $.asRange.noConflict
method to revert to it.
<script src="other-plugin.js"></script>
<script src="jquery-asRange.js"></script>
<script>
$.asRange.noConflict();
// Code that uses other plugin's "$().asRange" can follow here.
</script>
Tested on all major browsers.
Latest ✓ | Latest ✓ | Latest ✓ | Latest ✓ | 9-11 ✓ | Latest ✓ |
As a jQuery plugin, you also need to see the jQuery Browser Support.
Anyone and everyone is welcome to contribute. Please take a moment to
review the guidelines for contributing. Make sure you're using the latest version of jquery-asRange
before submitting an issue. There are several ways to help out:
jquery-asRange
is built modularly and uses Gulp as a build system to build its distributable files. To install the necessary dependencies for the build system, please run:
npm install -g gulp
npm install -g babel-cli
npm install
Then you can generate new distributable files from the sources, using:
gulp build
More gulp tasks can be found here.
To see the list of recent changes, see Releases section.
Copyright (C) 2016 amazingSurge.
Licensed under the LGPL license.
FAQs
A jquery plugin for convent input into range slider.
The npm package jquery-asRange receives a total of 16 weekly downloads. As such, jquery-asRange popularity was classified as not popular.
We found that jquery-asRange demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.