Git Product home page Git Product logo

custom-selectbox's Introduction

#Custom SelectBox UI Replacement#

This is a UI replacement for default select boxes that leaves mobile browsers (iOS and Android) default UI intact.

##Usage##

###HTML###

...

<form>
  <select class="sparkbox-custom">
    <option value="the_googs">Chrome</option>
    <option value="the_faris">Safari</option>
    <option value="foxfire">Firefox</option>
    <option value="the_splora">IE 9</option>
  </select>
  <input type="submit"/>
</form>

###JavaScript### <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script src="js/jquery.sparkbox-select.js"></script> <script> ('.sparkbox-custom').sbCustomSelect(); </script>

##Tested in## ###Mac###

  • Chrome 10
  • Safari 5.0.3
  • Firefox 3.6
  • Firefox 4

###Windows###

  • Chrome 10
  • Firefox 3.6
  • Firefox 4
  • Opera 11
  • IE 8
  • IE 7
  • IE 6

#Legal Stuff Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

custom-selectbox's People

Contributors

andrewrocco avatar robtarr avatar sanchesfree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

custom-selectbox's Issues

Multiple selects

Hi,

Thank you for the plugin, so far it worked really well. However I have found out few difficulties when using multiple custom selects. The behaviour gets quite strange. Arrows UP and DOWN do not work properly.

It could be also good to have only one dropdown-menu opened in one time. So when you click to second one the first one which is opened gets closed.

Double .selected class

If within options there is same words it gets class .selected try example below and you'll see that both first options will be selected.

<select class="sparkbox-custom">
    <option value="the_googs">Chrome</option>
    <option value="the_faris">Chrome Safari</option>
    <option value="foxfire">Firefox</option>
    <option value="the_splora">IE 9</option>
  </select>

Values wrong position on image

I've noticed an annoying bug with this great script. I'm using a regular layout (container, content div) and if I insert an image tag in HTML, above the

code which includes the sparkbox dropdowns, the dropdown starts at the wrong position. Even if I remove all HTML and just insert a

tag above the , it acts this way.

See this screenshot for further info. Is there a workaround or bugfix available for this?

Screenshot
Format: Start position bug Chrome and Safari

Can´t use onchange="location.href = this.value;" at <select>

I have 3 options in my select...
First one has no link...
Second and third has different links...

But using onchange="location.href = this.value;" at tag...
Things just got crazy... I can´t even load the webpage because somehow, when page loads...
Select catchs the first option text as a link.

Can you help me, please?

Thanks.

Values wrong position on image

I've noticed an annoying bug with this great script. I'm using a regular layout (container, content div) and if I insert an image tag in HTML, above the FORM html element which includes the sparkbox dropdowns, the dropdown starts at the wrong position. Even if I remove all HTML and just insert an IMG tag above the FORM it acts this way.

See this screenshot for further info. Is there a workaround or bugfix available for this?

Screenshot
Format: Start position bug Chrome and Safari

Z-index Not Working in IE7

The sub-nav appears below other elements in IE7 but works fine in the other major browsers (Firefox, Chrome, Safari, IE8).

jquery form selectors not working

When you try and use jquery to change the selected item (such as a reset button) nothing happens. Sparkbox seems to break something. Even the underlying select lists do not change.

I have tested my functions with sparkbox on and off. Works when off but is broken when sparkbox is on

reproduce by trying to set the value of a select list while using sparkbox $("select#elementid").val('a value')

Dropdown breaks on LIVE added elements

If I insert a dropdown with jQuery after the page is loaded - the dropdown breaks. The styled dropdown is seen, and the source shows that it populated the ul, but the click functionality is broken and doesn't work at all.

Errors with selection & drop-down "search" feature.

Gang - good work on this plugin, however there are some very fatal flaws that are preventing me from using it. I hope my etiquette is proper here, as I've never used github before.

FIrst off - the latest mixer version is what seems to be working the best. However, it still doesn't "close" the drop-down if you hit "enter" on an item.

The biggest problem is that in my list, if I chose an item far down in my list, it does not "select" the right one. As in, the proper value will not be displayed.

Below is my list.

select your state Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming -------------- PROVINCES Alberta British Columbia Manitoba New Brunswick New Foundland Northwest Territories Nova Scotia Ontario Prince Edward Island Quebec Saskatchewan Yukon $('#state').sbCustomSelect();

Uncaught TypeError: Cannot set property 'selected' of undefined

Showing error for the following drop down
<select name="data[Album][album_date][day]" class="sparkbox-custom">
<option value="">DD</option>
<option value="01">1</option>
<option value="02">2</option>
</select>

If the key is 1, 2 it is working... Otherwise it is showing error "Uncaught TypeError: Cannot set property 'selected' of undefined" on jquery.sparkbox-select.js at line 35

Multiple select boxes

Hi,
First - thanks for great plugin it really helped me.

There is a problem when using multiple select boxes specially one under another.
Drop down block wont hide when you click on another select box without choosing an option in first one.
Also in that situation z-index is an issue as the second select box is displayed over drop down block of the first one.
Here's a quick and dirty fix i've used to deal with this:

var viewList = function(e) {
    var $this = $(this);
    clear();
++  $('.sb-dropdown').fadeOut('fast');
    $this.closest('.sb-custom').find('.sb-dropdown').fadeIn('fast');
++  $('.sb-dropdown').css("z-index","99");
++  $this.closest('.sb-custom').find('.sb-dropdown').css("z-index","100");
    e.preventDefault();
};

After this fix you can encounter an problem with flashing drop down after making selection. I still don't know how to fix it.
For now i've just deleted focus binding for drop down.

Errors with selection & drop-down "search" feature.

Gang - good work on this plugin, however there are some very fatal flaws that are preventing me from using it. I hope my etiquette is proper here, as I've never used github before.

FIrst off - the latest mixer version is what seems to be working the best. However, it still doesn't "close" the drop-down if you hit "enter" on an item.

The biggest problem is that in my list, if I chose an item far down in my list, it does not "select" the right one. As in, the proper value will not be displayed.

Below is my list. If I "Saskatchewan", for example, my custom-selectbox will show "Hawaii" for some reason... I can't get the following to show up as html. Github keeps parsing it... blaaaah

'select your state
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
District of Columbia
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming
--------------
PROVINCES
Alberta
British Columbia
Manitoba
New Brunswick
New Foundland
Northwest Territories
Nova Scotia
Ontario
Prince Edward Island
Quebec
Saskatchewan
Yukon
'
$('#state').sbCustomSelect();

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.