web/wp-content/themes/IRI-Theme/js/jquery.skinned-select.js
author hurons@caf4f556-3d62-0410-8435-a86758001935
Mon, 08 Feb 2010 14:15:44 +0000
changeset 144 df0ebfb22f63
parent 136 bde1974c263b
permissions -rw-r--r--
- Added Path variable in the config file for the LDT's donwloader script (functions.php) - Added the /ldt_template in the res directory - Modify default-widgets.php to open in blank all the rss link - clean a litlle comment in searchform.php

$(document).ready(
  function() {
    $('.my-skinnable-select').each(
      function(i) {
        selectContainer = $(this);
        // Remove the class for non JS browsers
        selectContainer.removeClass('my-skinnable-select');
        // Add the class for JS Browers
        selectContainer.addClass('skinned-select');
        // Find the select box
        selectContainer.children().before('<div class="select-text">a</div>').each(
          function() {
            $(this).prev().text(this.options[0].innerHTML)
          }
        );
        // Store the parent object
        var parentTextObj = selectContainer.children().prev();
        // As we click on the options
        selectContainer.children().click(function() {
          // Set the value of the html
          parentTextObj.text(this.options[this.selectedIndex].innerHTML);
        })        
      }
    );
  }
);