j-Pages
The component is a better alternative to the j-Section component. As a result, you can easily make a multi-page app with dynamic content loading when needed. The result looks very intuitive for mobile devices or desktop computers.
Main configuration:
margin {Number/String}a top margin (default:0)autowill appliedoffset.topvalue
margintype {String}can containoffset(default) orpositionvaluedelay {Number}animation delay (default:220)parent{String} optional, a selector to an element with a fixed height (default:parentelement)scrollbarshadow {Boolean}enables shadow for the scrollbar (default:false)loading {String}optional, a link to thefunction(show_loading {Boolean})
Section attribute configuration data-config:
if {String}a condition for displaying of pageurl {String}URL address for getting HTML contentpath {String}the value will replace~PATH~pharses (default:config.if)id {String}the value will replace~ID~pharsesanim {String}animation type, supported valuesleft(default),right,toporbottomscrollbar {Boolean}appends a custom scrollbar into the content (default:true)scrolltop {Boolean}enables auto-scrollreload {String}a link to thefunction(el), it's executed when the page is displayedhide {String}a link to thefunction(el), it's executed when the page is hiddencheck {String}a link to thefunction(next, el)next {Function}continues with page displaying
autofocus {Boolean}performs autofocus for the current page
Use it with <ui-component name="pages">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.
<style>
body { padding: 0; margin: 0; overflow: hidden; }
</style>
<ui-component name="pages" path="common.page" config="parent:window">
<section class="hidden invisible" data-config="if:page1;anim:left">
<div class="padding">
<div style="background-color:#F0F0F0;margin:30px auto;padding:30px;max-width:600px;border-radius:10px">
PAGE 1
</div>
</div>
</section>
<section class="hidden invisible" data-config="if:page2;anim:right">
<div class="padding">
<div style="background-color:#F0F0F0;margin:30px auto;padding:30px;max-width:600px;border-radius:10px">
PAGE 2
</div>
</div>
</section>
<section class="hidden invisible" data-config="if:page3;anim:bottom">
<div class="padding">
<div style="background-color:#F0F0F0;margin:30px auto;padding:30px;max-width:600px;border-radius:10px">
PAGE 3
</div>
</div>
</section>
</ui-component>
<script>
var common = {};
function togglepage() {
var val = common.page;
switch (val) {
case 'page1':
val = 'page2';
break;
case 'page2':
val = 'page3';
break;
case 'page3':
default:
val = 'page1';
break;
}
SET('common.page', val);
}
setInterval(togglepage, 2000);
togglepage();
</script>