
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
jquery.customSelect
Advanced tools
## Getting started ### [See Basic Demo](http://jsfiddle.net/adamco/hysHB/) ### Initiate the plugin ```javascript $(document).ready(function(){ $('#someSelectBox').customSelect(); }); ``` ### Style using CSS however you like ```CSS .customSelect { /* Thi
$(document).ready(function(){
$('#someSelectBox').customSelect();
});
.customSelect {
/* This is the default class that is used */
/* Put whatever custom styles you want here */
}
.customSelect.customSelectHover {
/* Styles for when the select box is hovered */
}
.customSelect.customSelectOpen {
/* Styles for when the select box is open */
}
.customSelect.customSelectFocus {
/* Styles for when the select box is in focus */
}
.customSelect.customSelectDisabledOption {
/* Styles for when the selected item is a disabled one */
}
.customSelect.customSelectDisabled {
/* Styles for when the select box itself is disabled */
}
.customSelectInner {
/* You can style the inner box too */
}
Useful if any modifications are made to the select box after customSelect() has been applied
$('#someSelectBox').customSelect();
// as an example....
$('#someSelectBox').width(500).append('<option>New!</option>');
// Trigger an refresh on the select box. Good as new!
$('#someSelectBox').trigger('render');
In a responsive layout, you may need to change the size / style of the select box.
The best way to do this is with matchMedia
. Consider using a matchMedia polyfill for better browser support. The addListener
extension makes it very easy to update the customSelect:
// add a media query listener and trigger a customSelect update whenever the query gets matched or unmatched
matchMedia('only screen and (max-width: 480px)').addListener(function(list){
$('#mySelectBox').trigger('render');
});
There are a few extra options if you need them
$('#someSelectBox').customSelect({
customClass: "mySexySelect", // Specify a different class name (default is 'customSelect')
mapClass: true, // Copy any existing classes from the given select element (defaults to true)
mapStyle: true // Copy the value of the style attribute from the given select element (defaults to true)
});
Version 0.5.1 (19/03/2013)
Version 0.5.0 (19/03/2013)
Version 0.4.1 (26/05/2013)
customSelectOpen
handling in FFEsc
& Enter
key supportVersion 0.4.0 (26/04/2013)
customClass
, that classname will be used for all states.{customClass:'mySexySelect'}
will produce class names like mySexySelectOpen
, mySexySelectFocus
, mySexySelectHover
hasCustomSelect
class, which will maintain the plugin's default namespace since it is applied to the select box to distinguish it from an unstyled select.Version 0.3.7 (26/04/2013)
disabled
<option>
via customSelectDisabledOption
classVersion 0.3.6 (16/04/2013)
Version 0.3.5 (16/04/2013)
customSelectOpen
Version 0.3.4 (15/04/2013)
customSelectOpen
class on mouseup to resolve issue #29 (http://git.io/jztAlQ)Version 0.3.3 (04/03/2013)
customSelectSpan
reference to changed() functionVersion 0.3.2 (28/02/2013)
disabled
select boxes via customSelectDisabled
classVersion 0.3.0 (12/02/2013)
Version 0.2.5 (04/02/2013)
Version 0.2.4 (03/02/2013)
Version 0.2.3 (30/01/2013)
Version 0.2.1 (17/12/2012)
Version 0.2.0
CHANGES IN 0.2.0
Copyright 2013 Adam Coulombe
Dual licensed under the MIT and GPL licenses:
This lightweight, unintrusive technique uses the native select box functionality of the web browser, and overlays a stylable element in order to acheive your desired look. Since it makes use of default browser functionality,it can be treated just like any ordinary HTML select box.
FAQs
## Getting started ### [See Basic Demo](http://jsfiddle.net/adamco/hysHB/) ### Initiate the plugin ```javascript $(document).ready(function(){ $('#someSelectBox').customSelect(); }); ``` ### Style using CSS however you like ```CSS .customSelect { /* Thi
We found that jquery.customSelect 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.