Plug-in Linkselect from Giva Labs

Plug-in Linkselect from Giva Labs

I have a select list with some options opening URLs in a new window and I use the below jQuery:

  1.     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

 

The script for linking the options of the select list is the following:

  1.     <script type="text/javascript">
  2.       $(document).ready(function() {
  3.       $('.openSelect').change(function(){
  4.         var selectedValue=$(this).val();
  5.           if (selectedValue.match(/http/)) {
  6.            var open = window.open($(this).val(),'_blank');
  7.            if (open == null || typeof(open)=='undefined'){
  8.            alert("Please turn off pop-up blocker and reload this page to visit:  " + selectedValue);
  9.            }
  10.      }
  11.     });
  12.     });
  13.     </script>

 

I’m trying to implement the plug-in Linkselect from Giva Labs to fix the width problem with IE6, 7 and 8 (dropdown width not adjusting to content) but it’s not working.

http://www.givainc.com/labs/linkselect_jquery_plugin.htm#options

 

My select tag is the following

  1.     <select class="openSelect" style="width:px; color:#0066ff;">

 

so I added the the following in the head:

  1.     <script type="text/javascript" src="js/jquery.linkselect.min.js"></script>
  2.     <script type="text/javascript" src="js/jquery.bgiframe.js"></script>
  3.     <link type="text/css" href="css/jquery.linkselect.css" rel="stylesheet" media="all" />

 

and added $('.select.openSelect').openSelect(); to my script as below:

  1.     <script type="text/javascript">
  2.     $(document).ready(function() {
  3.      $('.select.openSelect').openSelect();
  4.       $('.openSelect').change(function(){
  5.       var selectedValue=$(this).val();
  6.       if (selectedValue.match(/http/)) {
  7.            var open = window.open($(this).val(),'_blank');
  8.            if (open == null || typeof(open)=='undefined'){
  9.            alert("Please turn off pop-up blocker and reload this page to visit:  " + selectedValue);
  10.            }
  11.          }
  12.       });
  13.     });
  14.     </script>
It doesn't work so any idea where my mistake is??

 

Thanks