javascript - how to make the -moz-appearance: spinner-downbutton be at right most side -
is there way make @ right side, or maybe suggest me how make input txt select button.
demo expandable list
/* use apearance of input txt have downbbutton*/ <style> #dropdown{ -moz-appearance: spinner-downbutton; -webkit-appearance: spinner-downbutton; } </style> <script> </script> </head> <body> <div id="listcontainer"> <div> <input type="text" id="dropdown" > </div> <div id="orgcontainer"> <ul id="explist"> <li> item <ul> <li> item a.1 <ul> <li> <span>kalbo na panot.</span> </li> </ul> </li> <li> item a.2 </li> <li> item a.3 <ul> <li> <span>macho na bading.</span> </li> </ul> </li> </ul> </li> <li> item b </li> <li> item c <ul> <li> item c.1 </li> <li> item c.2 <ul> <li> <span>buntis na sungke.</span> </li> </ul> </li> </ul> </li> </ul> </div> </div> </body> </html>
this html.
this script(script.js)
function preparelist() { $('#explist').find('li:has(ul)') .click( function(event) { if (this == event.target) { $(this).toggleclass('expanded'); $(this).children('ul').toggle('medium'); } return false; }) .addclass('collapsed') .children('ul').hide(); //create button funtionality $('#expandlist') .unbind('click') .click( function() { $('.collapsed').addclass('expanded'); $('.collapsed').children().show('medium'); }) $('#collapselist') .unbind('click') .click( function() { $('.collapsed').removeclass('expanded'); $('.collapsed').children().hide('medium'); }) }; $(document).ready( function() { $("#orgcontainer").hide(); $("#dropdown").click(function(){ $("#orgcontainer").toggle(); $(this).blur(); }); preparelist() });
thank your, considering question. thank in advance.
mate, if need number value, why not use
<input type="number" >
by default, dropdown selecting values,
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_number
Comments
Post a Comment