Skip to content

Commit a73e938

Browse files
committed
Make Demo page responsive
1 parent 1a4f0ce commit a73e938

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed

public/demo.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
<link rel="stylesheet" href="customoptions.css">
1212
<link rel="stylesheet" href="lib/prism.css">
1313

14+
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
15+
1416
<meta property="og:title" content="jQuery Selectric">
1517
<meta property="og:type" content="website">
1618
<meta property="og:description" content="Fast, simple and light jQuery plugin to customize HTML selects">
@@ -264,6 +266,8 @@ <h3>Custom markup for items box</h3>
264266
<pre data-src="customoptions.css"></pre>
265267
</div>
266268
</div>
269+
270+
<div class="demo-spacer"></div>
267271
</div>
268272

269273
<div class="theme-roller">
@@ -381,7 +385,7 @@ <h3>Sizes</h3>
381385
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
382386
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
383387

384-
ga('create', 'UA-42240250-1', 'lcdsantos.github.io');
388+
ga('create', 'UA-42240250-1', 'auto');
385389
ga('require', 'displayfeatures');
386390
ga('send', 'pageview');
387391
</script>

public/lib/demo.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
$('#button-round-slider').data('key', 'buttonRadius');
5151
$('#button-position-slider').data('key', 'buttonPosition');
5252

53+
if ( /android|ip(hone|od|ad)/i.test(navigator.userAgent) ) {
54+
$('#presets').find('option[value="custom"]').remove();
55+
}
56+
5357
$('#presets').change(function(e) {
5458
e.preventDefault();
5559

@@ -152,6 +156,8 @@
152156
/*======================================
153157
Demos
154158
======================================*/
159+
$.fn.selectric.defaults.disableOnMobile = false;
160+
155161
$('#basic').selectric();
156162

157163
/*------------------------------------*/

public/style.css

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,9 @@ table code {
318318
}
319319

320320
.demo .view {
321-
width: 40%;
321+
width: 38%;
322322
float: left;
323+
margin-right: 2%;
323324
}
324325

325326
.demo .code {
@@ -868,6 +869,62 @@ table code {
868869
.bottom-spacer {
869870
height: 40px;
870871
}
872+
873+
/* Demo page */
874+
.theme-roller {
875+
left: 0;
876+
right: 0;
877+
bottom: 0;
878+
top: auto;
879+
width: auto;
880+
border-radius: 0;
881+
border: none;
882+
border-top: 1px solid #CCC;
883+
padding: 10px;
884+
box-shadow: 0 -1px 10px -6px #000;
885+
}
886+
887+
.theme-roller h2 {
888+
font-size: 16px;
889+
}
890+
891+
.theme-roller form {
892+
float: left;
893+
width: 50%;
894+
}
895+
896+
.theme-roller select {
897+
height: 34px;
898+
}
899+
900+
.theme-roller .bt-download {
901+
float: right;
902+
width: 46%;
903+
margin-top: 0;
904+
}
905+
906+
.theme-roller .bt-view-raw {
907+
clear: both;
908+
position: absolute;
909+
top: 4px;
910+
right: 10px;
911+
}
912+
913+
.demo .view,
914+
.demo .code {
915+
float: none;
916+
width: auto;
917+
margin-right: auto;
918+
margin-left: auto;
919+
}
920+
921+
.demo .code {
922+
margin-top: 10px;
923+
}
924+
925+
.demo-spacer {
926+
height: 88px;
927+
}
871928
}
872929

873930
@media screen and (max-width: 540px) {

0 commit comments

Comments
 (0)