Guest User

Untitled

a guest
Feb 8th, 2013
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. select {
  2. border: 1px solid #65A6BA;
  3. font-size: 11px;
  4. margin-left: 22px;
  5. width: 166px;
  6. }
  7.  
  8. <select>
  9. <option value="1">Some text</option>
  10. <option value="2">Text Larger Than the Width of select</option>
  11. <option value="3">Some text</option>
  12. <option value="4">Some text</option>
  13. <option value="5">Some text</option>
  14. </select>
  15.  
  16. select {
  17. border: 1px solid #65A6BA;
  18. font-size: 11px;
  19. margin-left: 22px;
  20. width: 166px;
  21. overflow:visible ;
  22. }
  23.  
  24. select:focus { width:auto ;
  25. position:relative ;
  26. }​
  27.  
  28. $el = $("select.fixedWidth");
  29. $el.data("origWidth", $el.outerWidth())
  30.  
  31. $el.mouseenter(function(){
  32. $(this).css("width", "auto");
  33. })
  34. .bind("blur change", function(){
  35. el = $(this);
  36. el.css("width", el.data("origWidth"));
  37. });
Add Comment
Please, Sign In to add comment