Using Href Links Inside
i just downloaded the source code from this topic http://tympanus.net/codrops/2012/11/29/simple-effects-for-drop-down-lists/ demo http://tympanus.net/Development/SimpleDropDownEff
Solution 1:
Try this
<select id="cd-dropdown" name="cd-dropdown" class="cd-select">
<option value="-1" selected>choose an option to test</option>
<option value="1" class="icon-monkey">Students</option>
<option value="2" class="icon-bear">Courses</option>
<option value="3" class="icon-squirrel">Instructors</option>
<option value="4" class="icon-elephant">Departments</option>
</select>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
jQuery('#cd-dropdown').on('change', function(){
if(jQuery(this).val() == 1){
window.location.href = 'http://google.com'
}
// and so on
})
</script>
You have to give the destination URL for all options jQuery code.
Solution 2:
Try this
$('#cd-dropdown').on('change', function(){
var value = $(this).val();
if(value == 1){ // that is for Students
window.location.href = 'http://google.com';
}
// and so on
})
Solution 3:
Try This
$('.cd-dropdown li').click(function(){
if($(this).attr('data-value')==1){
window.location.href = 'http://google.com';
}
})
The plugin replaces select box [id=cd-dropdown] with ul [class=cd-dropdown]
Post a Comment for "Using Href Links Inside