Created
March 22, 2015 14:46
-
-
Save kapilgarg1996/c48f8d00a72ea0fffd4b to your computer and use it in GitHub Desktop.
jQuery Mobile issue template // source http://jsbin.com/yematejiru
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>jQuery Mobile issue template</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/git/jquery.mobile-git.css"> | |
<script src="http://code.jquery.com/jquery-1.11.1.js"></script> | |
<script src="http://code.jquery.com/mobile/git/jquery.mobile-git.js"></script> | |
<script> | |
// Your JavaScript ... | |
</script> | |
<style> | |
#edit-with-js-bin { display: none !important; } | |
</style> | |
<style id="jsbin-css"> | |
.ui-max-width{ | |
max-width : 100% ; | |
} | |
</style> | |
</head> | |
<body> | |
<div data-role="page"> | |
<div data-role="header"> | |
<h1>Issue template</h1> | |
</div><!-- /header --> | |
<div class="ui-content"> | |
<div id="test" class="ui-field-contain"> | |
<label for="select-custom-19">Multiple:</label> | |
<select name="select-custom-19" id="select-custom-19" multiple="multiple" data-native-menu="false" data-mini="false" data-inline="true"> | |
<option>Choose options</option> | |
<option value="1">The 1st Option</option> | |
<option value="2" selected="selected">The 2nd Option</option> | |
<option value="3" selected="selected">The 3rd Option</option> | |
<option value="4" selected="selected">The 4th Option</option> | |
<option value="5" selected="selected">The 5th Option</option> | |
<option value="6" selected="selected">The 6th Option</option> | |
<option value="7" selected="selected">The 7th Option</option> | |
<option value="8" >The 8th Option</option> | |
<option value="9">The 9th Option</option> | |
<option value="10" >The 10th Option</option> | |
<option value="11">The 11th Option</option> | |
<option value="12" selected="selected">The 12th Option</option> | |
<option value="13" selected="selected">The 13th Option</option> | |
<option value="14" selected="selected">The 14th Option</option> | |
<option value="15" selected="selected">The 15th Option</option> | |
</select> | |
</div> | |
</div><!-- /content --> | |
</div><!-- /page --> | |
<script id="jsbin-javascript"> | |
$(document).ready(function(){ | |
var $select = $(".ui-select") ; | |
var width = $select.width() ; | |
var parentWidth ; | |
parentWidth = $("body").width() ; | |
if(width > parentWidth) | |
$select.addClass("ui-max-width") ; | |
$select.change(function(){ | |
if(width > parentWidth) | |
$(this).addClass("ui-max-width") ; | |
else | |
$(this).removeClass("ui-max-width") ; | |
}) ; | |
}); | |
</script> | |
<script id="jsbin-source-css" type="text/css">.ui-max-width{ | |
max-width : 100% ; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
$(document).ready(function(){ | |
var $select = $(".ui-select") ; | |
var width = $select.width() ; | |
var parentWidth ; | |
parentWidth = $("body").width() ; | |
if(width > parentWidth) | |
$select.addClass("ui-max-width") ; | |
$select.change(function(){ | |
if(width > parentWidth) | |
$(this).addClass("ui-max-width") ; | |
else | |
$(this).removeClass("ui-max-width") ; | |
}) ; | |
});</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
.ui-max-width{ | |
max-width : 100% ; | |
} |
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
$(document).ready(function(){ | |
var $select = $(".ui-select") ; | |
var width = $select.width() ; | |
var parentWidth ; | |
parentWidth = $("body").width() ; | |
if(width > parentWidth) | |
$select.addClass("ui-max-width") ; | |
$select.change(function(){ | |
if(width > parentWidth) | |
$(this).addClass("ui-max-width") ; | |
else | |
$(this).removeClass("ui-max-width") ; | |
}) ; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment