Coder Social home page Coder Social logo

selectinspiration's Introduction

Inspiration for Custom Select Elements

Creative styles and ideas for custom select elements.

Article on Codrops

Demo

Integrate or build upon it for free in your personal or commercial projects. Don't republish, redistribute or sell "as-is".

Read more here: License

© Codrops 2014

selectinspiration's People

Contributors

botelho avatar crnacura avatar glen-84 avatar mindplay-dk avatar patrickgrey 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  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

selectinspiration's Issues

how can I add scrollbar and edit its style

i really love this style of selection box! however, i have a lot of option in selection...
so i need to add scrollbar in it. but when i add scrollbar, its style is not suitable with the original
like this picture (it's very strange in visual)
dropdown menu

Therefore, i want to change the scollbar style like below
dropdown menu-want

i have used the " css ::-webkit-scrollbar" , it works in chrome but not in firefox
i want to use a way to across browser so i find jquery way to do that.
but seem to lots of jquery way having some problmes...
( i also tried to use the jscrollpane ((http://jscrollpane.kelvinluck.com/)) , lots of pepole recommand that. but it can't work)
can any way to solve that?
thank you and forgive my poor english..

Better way to get selected option

From what I understand, it's possible for the selected property of an option to be set without the attribute being present. For this reason, I think that it would be better to use the following:

var selectedOpt = this.el.options[this.el.selectedIndex];

Instead of the current:

var selectedOpt = this.el.querySelector('option[selected]');

Would you accept a PR?

data-link don't work

The attribute data-link for open a link in option list doesn't work.

To fix this, change line 130 in selectFx.js to:
link = 'data-link="' + el.getAttribute( 'data-link' ) + '"';

Thanks for this tutorial!

Some enhancements

First of all: thank you, this is a lovely project!
I tweaked it to my needs, and made some changes of my own:

<select class="select">...</select>

Can now be simply:

<select>...</select>

The z-index is decremented each time a SelectFx is instantiated (because there were overlapping), and the appendChild(this.selEl) call has been fixed (was inserting as the end of the parent, not at the right place).

I can fork the project and make a merge request, are you interested in?
Cheers,

Jk.

Doesn't work

It doesn't work. Only HTML is rendered. No selects work.

I added styles:

<link rel="stylesheet" href="/assets/select/css/cs-select.css">
<link rel="stylesheet" href="/assets/select/css/cs-skin-border.css">

I added .js. I even wrapped them into jQuery $(document).ready(function () {...}) function.

<script type="text/javascript" src="/assets/select/js/classie.js"></script>
<script type="text/javascript" src="/assets/select/js/selectFx.js"></script>

I copy-pasted HTML markup:

<div class="cs-select cs-skin-border" tabindex="0"><span class="cs-placeholder">Preferred contact method</span>
    <div class="cs-options">
        <ul>
            <li data-option="" data-value="email"><span>E-Mail</span>
            </li>
            <li data-option="" data-value="twitter"><span>Twitter</span>
            </li>
            <li data-option="" data-value="linkedin"><span>LinkedIn</span>
            </li>
        </ul>
    </div>
    <select class="cs-select cs-skin-border">
        <option value="" disabled="" selected="">Preferred contact method</option>
        <option value="email">E-Mail</option>
        <option value="twitter">Twitter</option>
        <option value="linkedin">LinkedIn</option>
    </select>
</div>

Doesn't work. What did I miss? Why it doesn't work?

overflow won't scroll with up/down keys

Hi,

I have a long country list but it can only take up say 300px height, so needs overflow scrolling.
i tried putting overflow scroll on the element but navigating up & down with the keys does not scroll
the list.

could you give an example of how this should be set up please if I've missed something?

thanks
J

Add aria-tags

Loving the script!

I implemented my own version of it in ES2015, and it works beautifully. However, I added the correct aria-tags as well - perhaps you should do the same?

Pls publish selectFx as npm Package

how to use selectFx as module and how to import it to our project

and how to use classie as global module coz i get this error?

classie is undefined

How to trigger change event

I am using “overlay” mode, it is simply amazing. Thanks. Yet I have one question. I need to trigger change event from outside. I init it as:

vwt_SelectInstance = new selectFx(el,{stickyPlaceholder:false, 
  onChange:function(el){
    $('.jq-exf-conditional').load("<?=base_url('app/load_form');?>",{f:el});
  }
});

How can I trigger onChange event after page is fully loaded.

< ?php if($id==TRUE):? >
vwt_SelectInstance.trigger('change') // I need something like this :)
< ?php endif;? >

Thanks for any help

Add package.json

Please add a valid package.json manifest to your repo to enable usage of npm/yarn install to load your plugin.

I would send you a pull request but the details inside package.json like author and licenses are not obvious.

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.