Hello. I have a simple script that I've made -- works locally when I
try it in the Firebug console but not when loaded as a userscript. No
errors, just nothing happens.

// ==UserScript==
// @name          Show Dropdown Options
// @namespace url(http://www.w3.org/1999/xhtml);
// @description   Show the contents of a dropdown when you focus it.
// @author        dep
// @include       *
// @exclude         http*://mail.google.com/*
// @exclude         http://*google.com/reader/*
// ==/UserScript==

var oSels = document.getElementsByTagName("select");

for(x=0; x < oSels.length; x++) {
  oSels[x].onfocus = function () {
    var optionsArray = new Array();
    for (var y = 0; y < this.options.length; y++) {
      optionsArray.push(" " + this[y].text)
    }
    var box = document.createElement('div');
    box.className = "dropdown_shower";
    box.innerHTML = optionsArray;
    this.parentNode.appendChild(box);
  };
}

function addStyles(css) {
  var css = ".dropdown_shower{"+
  " -moz-border-radius:7px !important;"+
  " -webkit-border-radius:7px !important;"+
  "     position:absolute;!important;"+
  "     background-color:#ffffff !important;"+
  "     border:1px solid #bbbcbf !important;"+
  "     padding:5px!important;"+
  "}"

  var head=document.getElementsByTagName('head')[0];
  if (head) {
    var style=document.createElement('style');
    style.type='text/css';
    style.innerHTML=css;
    head.appendChild(style);
  }
}

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to