Created
October 23, 2013 06:07
-
-
Save ichi/7113301 to your computer and use it in GitHub Desktop.
selectタグで選んだらページ遷移
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
| $ -> | |
| $('select.jump').each -> | |
| $select = $ @ | |
| # 初期選択状態 | |
| if current = $select.data 'current' | |
| $select.val(current).trigger($.Event('select', current: current)) | |
| # changeしたら遷移 | |
| $select.on 'change', (ev)-> | |
| if href = ev.target.value | |
| location.href = href |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment