/**************************************************************** replaceDropdown() swaps the dropdown for a Select List to use HTML elements that can accept styling. Created by: Mike Behnke GitHub: https://github.com/localpcguy/ReplaceDropdown Version: 0.2 Params: Select ID Option defaults: divIDtext: "LinkList", linkIDtext: "Link", linkText: "", parent: "", // required for flipTop flipTop: false, ddClass: "ddlist", hideFirst: true Usage: $("select").replaceDropdown(); $("select").replaceDropdown({ ddClass: "dropdownList"}); ToDo: 1) Switch to class based selector rather than ID 2) Store created elements in closure for future manipulation rather than lookup each time 3) Setup timer variable and option to auto-close after the timer expires 4) Refactor code for size/performance 5) Refactor code into better "plugin" boilerplate *****************************************************************/
localpcguy/ReplaceDropdown
Replaces a select element with a div that includes a list of links built from the select object options
JavaScript