-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #5 - how to navigate to url on selectbox change event
Issue #1 - Focus issue on iOS safari
- Loading branch information
Rob LaPlaca
committed
Jul 25, 2013
1 parent
b3c3591
commit 1e255e9
Showing
2 changed files
with
80 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Custom SelectBox</title> | ||
<link rel="stylesheet" href="css/jquery.jscrollpane.css" /> | ||
<link rel="stylesheet" href="css/customSelectBox.css" /> | ||
<!-- example.css is throwaway code for demoing --> | ||
<link rel="stylesheet" href="css/example.css" /> | ||
</head> | ||
<body class="noJS" id="example-1"> | ||
<script> | ||
var bodyTag = document.getElementsByTagName("body")[0]; | ||
bodyTag.className = bodyTag.className.replace("noJS", "hasJS"); | ||
</script> | ||
|
||
<h2>Link Select</h2> | ||
|
||
<form method="GET" class="module-link-select" target="_blank"> | ||
<select class="custom"> | ||
<option value="">Select a link</option> | ||
<option value="http://www.google.com">Google</option> | ||
<option value="http://www.yahoo.com">Yahoo</option> | ||
<option value="http://www.bing.com">Bing</option> | ||
</select> | ||
</form> | ||
|
||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> | ||
<script src="js/jScrollPane.js"></script> | ||
<script src="js/jquery.mousewheel.js"></script> | ||
<script src="js/SelectBox.js"></script> | ||
<script> | ||
$(function() { | ||
|
||
$(".module-link-select").each(function() { | ||
var $form = $(this); | ||
|
||
var sb = new SelectBox({ | ||
selectbox: $form.find("select"), | ||
height: 150, | ||
width: 200, | ||
changeCallback: function(val) { | ||
if( val !== "" ) { | ||
$form.attr("action", val); | ||
$form.submit(); | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains 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