Created
December 23, 2014 22:12
-
-
Save kylewest/6a558eed30216c2fa663 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('#brandlist ul').hide().parent().append('<select>'); $('#brandlist ul li').each(function(){ var link = $(this).find('a'); | |
$('#brandlist select').append('<option value="'+link.attr('href')+'">'+link.html()+'</option>'); | |
}); | |
$('#brandlist select').on("change", function(){ | |
window.location.href = $(this).val(); | |
}); | |
$('#brandlist').before("//popular brands HTML. make sure to use single quotes (')"); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment