Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 8086d00

Browse files
author
Gabriel Schulhof
committed
Slider: Demo dynamic creation
(cherry picked from commit 9a060c1) Closes gh-7549 Fixes gh-7545
1 parent ebb6b41 commit 8086d00

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

demos/slider/index.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
margin-left: 15px;
2121
}
2222
</style>
23+
<script id="dynamic-slider">
24+
$( document ).on( "pagecreate", function() {
25+
$( "<input type='number' data-type='range' min='0' max='100' step='1' value='17'>" )
26+
.appendTo( "#dynamic-slider-form" )
27+
.slider()
28+
.textinput()
29+
});
30+
</script>
2331
</head>
2432
<body>
2533
<div data-role="page" class="jqm-demos" data-quicklinks="true">
@@ -134,6 +142,14 @@
134142
</form>
135143
</div><!-- /demo-html -->
136144

145+
<h2>Dynamically injected</h2>
146+
<p>The slider below has been created at runtime.</p>
147+
148+
<div data-demo-html="true" data-demo-js="#dynamic-slider">
149+
<form id="dynamic-slider-form">
150+
</form>
151+
</div>
152+
137153
</div><!-- /content -->
138154

139155
<?php include( '../jqm-navmenu.php' ); ?>

0 commit comments

Comments
 (0)