I am using this neat plugin for customising <select>
lists.
http://exodecreations.com/jQuery/jqDropDown.html
I am trying to come up with code so that when user selects each option, he is redirected to a page. My code is as follows:
<form action="#">
<select id="elidp" >
<option value='' disabled selected>Choose Location...</option>
<option value='http://www.google.com/'>New York</option>
<option value='http://www.google.com/'>LA</option>
</select>
</form>
Jquery:
jQuery(function() {
jQuery('#elidp').jqDropDown({
optionChanged: function(){ jQuery('#elidp').on('change', function () {var url = $(this).val(); if (url) {window.location = url;}return false;});},
direction: 'up',
defaultStyle: false,
containerName: 'theContainer',
toggleBtnName: 'awesomeToggleClass',
optionListName: 'thisListIsRocking',
effect: 'fade',
effectSpeed: 300
});
});
However, nothing happens when user changes options... Any ideas?
<li class="ddOption"><a class="" href="#" rel="http://www.google.com/">New York</a></li>
select list
option value to thehref
element ?