aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2014-03-31 00:00:05 -0700
committerChris Rebert <[email protected]>2014-03-31 00:00:05 -0700
commite59da022308c613deae3091723d5517bdaee9e43 (patch)
tree05fc9dfedd27eb996f6b0bf77d9d136304e358b3 /docs
parenta419e41c325c20a024ad0abea3d7cc8b537d2b26 (diff)
downloadbootstrap-e59da022308c613deae3091723d5517bdaee9e43.tar.xz
bootstrap-e59da022308c613deae3091723d5517bdaee9e43.zip
add document ready jQuery wrapper in Android Browser workaround
Diffstat (limited to 'docs')
-rw-r--r--docs/_includes/getting-started/browser-device-support.html12
1 files changed, 7 insertions, 5 deletions
diff --git a/docs/_includes/getting-started/browser-device-support.html b/docs/_includes/getting-started/browser-device-support.html
index 3e1dd3e66..183bb7668 100644
--- a/docs/_includes/getting-started/browser-device-support.html
+++ b/docs/_includes/getting-started/browser-device-support.html
@@ -176,11 +176,13 @@ if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
<p>On <code>&lt;select&gt;</code> elements, the Android stock browser will not display the side controls if there is a <code>border-radius</code> and/or <code>border</code> applied. Use the snippet of code below to remove the offending CSS and render the <code>&lt;select&gt;</code> as an unstyled element on the Android stock browser. The user agent sniffing avoids interference with Chrome, Safari, and Mozilla browsers.</p>
{% highlight html %}
<script>
-var nua = navigator.userAgent
-var isAndroid = (nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1 && nua.indexOf('Chrome') === -1)
-if (isAndroid) {
- $('select.form-control').removeClass('form-control').css('width', '100%')
-}
+$(function () {
+ var nua = navigator.userAgent
+ var isAndroid = (nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1 && nua.indexOf('Chrome') === -1)
+ if (isAndroid) {
+ $('select.form-control').removeClass('form-control').css('width', '100%')
+ }
+})
</script>
{% endhighlight %}
<p>Want to see an example? <a href="http://jsbin.com/OyaqoDO/2">Check out this JS Bin demo.</a></p>