SlideShare ist ein Scribd-Unternehmen logo
1 von 28
CORDOVA TRAINING
SESSION: 6 - USER INTERFACE USING FRAMEWORK7
SIDE PANELS
 Framework7 supports the use of side panels.
 Up to 2 panels, one on left side and another one on right side can be included.
 After we add panels we need to choose opening effect for each panel. This can be:
 Reveal
 Cover
SIDE PANELS
 A panel consist of 2 components – panel itself and the panel overlay.
 The panel overlay is the layer that overlap the screen when a panel is displayed.
SIDE PANELS
<div class="panel-overlay"></div>
<div class="panel panel-left panel-reveal">
Panel content
</div>
<div class="panel panel-right panel-cover">
Panel content
</div>
SIDE PANELS
 To open panel we need to add "open-panel" class to any HTML element (preferred to
link)
 To close panel we need to add "close-panel" class to any HTML element (preferred to
link)
 If you want to specify which panel should opened/closed, then it could be done via
additional data-panel="left" attribute on this HTML element.
SIDE PANELS
 <a href="#" data-panel="left" class="open-panel">Open Left Panel</a>
 $$('.open-left-panel').on('click', function (e) {
myApp.openPanel('left');
});
ALERT
 Framework7 provides methods to display alerts.
 To open Alert modal we should call one of the following App methods:
 alert(text, [title, callbackOk]);
 alert(text, [callbackOk]);
ALERT
 <p><a href="#" class="alert-text">Alert With Text</a></p>
 $$('.alert-text').on('click', function () {
myApp.alert('Here goes alert text');
});
CONFIRM
 Confirm modal usually used when it is required to confirm some action.
 To open Confirm modal we should also call one of the following App methods:
 confirm(text, [title, callbackOk, callbackCancel]);
 confirm(text, [callbackOk, callbackCancel]);
CONFIRM
 <a href="#" class="confirm-ok">Confirm with text and Ok callback</a>
 $$('.confirm-ok').on('click', function () {
myApp.confirm('Are you sure?', function () {
myApp.alert('You clicked Ok button');
});
});
PROMPT
 Prompt modal used when it is required to get some data/answer from user.
 To open Prompt modal we should also call one of the following App methods:
 prompt(text, [title, callbackOk, callbackCancel]);
 prompt(text, [callbackOk, callbackCancel]);
PROMPT
 <a href="#" class="prompt-ok">Prompt with text and Ok callback</a>
 $$('.prompt-ok').on('click', function () {
myApp.prompt('What is your name?', function (value) {
myApp.alert('Your name is "' + value + '". You clicked Ok button');
});
});
PRELOADER
 Preloader Modal is used to indicate some background activity (like Ajax request) and to
block any user actions during this activity.
 To open Preloader modal we should also call appropriate App method:
 showPreloader([title]);
 Because Preloader modal has not any buttons, it should be closed by JavaScript using
hidePreloader() method.
PRELOADER
 <a href="#" class="open-preloader">Open Preloader</a>
 $$('.open-preloader').on('click', function () {
myApp.showPreloader();
setTimeout(function () {
myApp.hidePreloader();
}, 2000);
});
INDICATOR
 If we only need to display a loading indicator to denote an ongoing action, we can use
the indicator widget. The most commonly used methods are:
 showIndicator();
 hideIndicator();
INDICATOR
 <a href="#" class="open-indicator">Open Indicator</a>
 $$('.open-indicator').on('click', function () {
myApp.showIndicator();
setTimeout(function () {
myApp.hideIndicator();
}, 2000);
});
POPUP
 Popup is a popup window with any HTML content that pops up over App's main
content.
 To create a popup layout, we need to add class="popup“.
 To create a full screen popup on tablets, use class=“popup tablet-fullscreen”
 To open popup we need to add "open-popup" class to any HTML element (prefered to
link)
 To close popup we need to add "close-popup" class to any HTML element (prefered to
link)
POPUP
 <a href="#" data-popup=".popup-about" class="open-popup">Open About Pop</a>
 <div class="popup popup-about">
<div class="content-block">
<p>About</p>
<p><a href="#" class="close-popup">Close popup</a></p>
<p>Lorem ipsum dolor ...</p>
</div>
</div>
POPUP
 $$('.open-about').on('click', function () {
myApp.popup('.popup-about');
});
ACTION SHEET
 Action Sheet is a slide-up pane for presenting the user with a list of actionable items.
 You can also use action sheets to prompt the user to confirm a potentially dangerous
action.
 Action sheet is the dynamic element, it could be created and opened only using
JavaScript.
ACTION SHEET
 <p><a href="#" class="ac-1">One group, three buttons</a></p>
 $$('.ac-1').on('click', function () {
var buttons = [
{text: 'Button1', onClick: function (){}},
{text: 'Button2‘, onClick: function (){}},
{text: 'Cancel', onClick: function (){}},
];
myApp.actions(buttons);
});
TABS
<div class="tabs">
<div class="tab active" id="tab1"></div>
<div class="tab active" id="tab2"></div>
<div class="tab active" id="tab3"></div>
</div>
TABS
 To switch to a tab, we need to follow the below code pattern:
 <a href="#tab1" class="tab-link">Tab 1</a>
 <a href="#tab2" class="tab-link">Tab 2</a>
LAZY LOADING
 Lazy Load is a concept that delays the loading of images on page while they are
outside of viewport until user scrolls to them.
 This helps to speed up the app loading phase.
 This method also improve scrolling performance and also save traffic.
LAZY LOADING
 To use lazy load on images:
 specify image source into data-src attribute instead of src attribute.
 add lazy class to image.
<img data-src="path/to/image.jpg" class="lazy">
LAZY LOADING
 To use lazy load on background images:
 specify element's background image source into data-background.
 add lazy class to image.
<img data-background="path/to/image.jpg" class="lazy">
LAZY LOADING
 If you want to add fade-in effect when image is loaded, you need to add additional
lazy-fadein class to image/element.
<img data-background="path/to/image.jpg" class="lazy lazy-fadein">
THANK YOU

Weitere ähnliche Inhalte

Was ist angesagt?

e computer notes - Creating views
e computer notes - Creating viewse computer notes - Creating views
e computer notes - Creating views
ecomputernotes
 
Labels and buttons
Labels and buttonsLabels and buttons
Labels and buttons
myrajendra
 
Session7 J2ME High Level User Interface(HLUI) part1-2
Session7 J2ME High Level User Interface(HLUI) part1-2Session7 J2ME High Level User Interface(HLUI) part1-2
Session7 J2ME High Level User Interface(HLUI) part1-2
muthusvm
 
Applet skelton58
Applet skelton58Applet skelton58
Applet skelton58
myrajendra
 
How to create a magento controller in magento extension
How to create a magento controller in magento extensionHow to create a magento controller in magento extension
How to create a magento controller in magento extension
Hendy Irawan
 

Was ist angesagt? (20)

Alpine.js: the outsider Javascript framework
Alpine.js: the outsider Javascript frameworkAlpine.js: the outsider Javascript framework
Alpine.js: the outsider Javascript framework
 
Progress Dialog, AlertDialog, CustomDialog
Progress Dialog, AlertDialog, CustomDialogProgress Dialog, AlertDialog, CustomDialog
Progress Dialog, AlertDialog, CustomDialog
 
Applet
 Applet Applet
Applet
 
java Unit4 chapter1 applets
java Unit4 chapter1 appletsjava Unit4 chapter1 applets
java Unit4 chapter1 applets
 
Day seven
Day sevenDay seven
Day seven
 
Awt, Swing, Layout managers
Awt, Swing, Layout managersAwt, Swing, Layout managers
Awt, Swing, Layout managers
 
Unique features of windows 8
Unique features of windows 8Unique features of windows 8
Unique features of windows 8
 
Best Practices for Magento Debugging
Best Practices for Magento Debugging Best Practices for Magento Debugging
Best Practices for Magento Debugging
 
Building scalable products with WordPress - WordCamp London 2018
Building scalable products with WordPress - WordCamp London 2018Building scalable products with WordPress - WordCamp London 2018
Building scalable products with WordPress - WordCamp London 2018
 
Basic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in JavaBasic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in Java
 
Java awt tutorial javatpoint
Java awt tutorial   javatpointJava awt tutorial   javatpoint
Java awt tutorial javatpoint
 
e computer notes - Creating views
e computer notes - Creating viewse computer notes - Creating views
e computer notes - Creating views
 
Labels and buttons
Labels and buttonsLabels and buttons
Labels and buttons
 
Session7 J2ME High Level User Interface(HLUI) part1-2
Session7 J2ME High Level User Interface(HLUI) part1-2Session7 J2ME High Level User Interface(HLUI) part1-2
Session7 J2ME High Level User Interface(HLUI) part1-2
 
Applet skelton58
Applet skelton58Applet skelton58
Applet skelton58
 
How to Create A Magento Adminhtml Controller in Magento Extension
How to Create A Magento Adminhtml Controller in Magento ExtensionHow to Create A Magento Adminhtml Controller in Magento Extension
How to Create A Magento Adminhtml Controller in Magento Extension
 
How to create a magento controller in magento extension
How to create a magento controller in magento extensionHow to create a magento controller in magento extension
How to create a magento controller in magento extension
 
tL19 awt
tL19 awttL19 awt
tL19 awt
 
Decompiladores
DecompiladoresDecompiladores
Decompiladores
 
DJango admin interface
DJango admin interfaceDJango admin interface
DJango admin interface
 

Ähnlich wie Cordova training : Day 6 - UI development using Framework7

Java script frame window
Java script frame windowJava script frame window
Java script frame window
H K
 
android activity
android activityandroid activity
android activity
Deepa Rani
 
02 programmation mobile - android - (activity, view, fragment)
02 programmation mobile - android - (activity, view, fragment)02 programmation mobile - android - (activity, view, fragment)
02 programmation mobile - android - (activity, view, fragment)
TECOS
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android Development
Jussi Pohjolainen
 
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
paynetawnya
 
How to create android push notifications with custom view
How to create android push notifications with custom viewHow to create android push notifications with custom view
How to create android push notifications with custom view
PushApps - Content Recommendation in Push Notifications
 
Parsing in ios to create an app
Parsing in ios to create an appParsing in ios to create an app
Parsing in ios to create an app
HeaderLabs .
 

Ähnlich wie Cordova training : Day 6 - UI development using Framework7 (20)

Java script frame window
Java script frame windowJava script frame window
Java script frame window
 
Eclipse Tricks
Eclipse TricksEclipse Tricks
Eclipse Tricks
 
android activity
android activityandroid activity
android activity
 
Java: Java Applets
Java: Java AppletsJava: Java Applets
Java: Java Applets
 
A comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter componentA comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter component
 
02 programmation mobile - android - (activity, view, fragment)
02 programmation mobile - android - (activity, view, fragment)02 programmation mobile - android - (activity, view, fragment)
02 programmation mobile - android - (activity, view, fragment)
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android Development
 
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
 
Android 3
Android 3Android 3
Android 3
 
Lesson 4
Lesson 4Lesson 4
Lesson 4
 
How to create android push notifications with custom view
How to create android push notifications with custom viewHow to create android push notifications with custom view
How to create android push notifications with custom view
 
Single Page Applications in Angular (italiano)
Single Page Applications in Angular (italiano)Single Page Applications in Angular (italiano)
Single Page Applications in Angular (italiano)
 
Pluggin creation
Pluggin creationPluggin creation
Pluggin creation
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK
 
ANDROID USING SQLITE DATABASE ADMINISTRATORS ~HMFTJ
ANDROID USING SQLITE DATABASE ADMINISTRATORS ~HMFTJANDROID USING SQLITE DATABASE ADMINISTRATORS ~HMFTJ
ANDROID USING SQLITE DATABASE ADMINISTRATORS ~HMFTJ
 
Chapt 04 user interaction
Chapt 04 user interactionChapt 04 user interaction
Chapt 04 user interaction
 
Perl gui
Perl guiPerl gui
Perl gui
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by step
 
Parsing in ios to create an app
Parsing in ios to create an appParsing in ios to create an app
Parsing in ios to create an app
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
 

Mehr von Binu Paul (11)

GIT
GITGIT
GIT
 
Cordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITECordova training - Day 9 - SQLITE
Cordova training - Day 9 - SQLITE
 
Cordova training - Day 8 - REST API's
Cordova training - Day 8 - REST API'sCordova training - Day 8 - REST API's
Cordova training - Day 8 - REST API's
 
Cordova training - Day 7 - Form data processing
Cordova training - Day 7 - Form data processingCordova training - Day 7 - Form data processing
Cordova training - Day 7 - Form data processing
 
Cordova training : Cordova plugins
Cordova training : Cordova pluginsCordova training : Cordova plugins
Cordova training : Cordova plugins
 
Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7Cordova training : Day 5 - UI development using Framework7
Cordova training : Day 5 - UI development using Framework7
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptCordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
 
Cordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to JavascriptCordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to Javascript
 
Cordova training - Day 3 : Advanced CSS 3
Cordova training - Day 3 : Advanced CSS 3Cordova training - Day 3 : Advanced CSS 3
Cordova training - Day 3 : Advanced CSS 3
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
 
Cordova training : Day 1 : Introduction to Cordova
Cordova training : Day 1 : Introduction to CordovaCordova training : Day 1 : Introduction to Cordova
Cordova training : Day 1 : Introduction to Cordova
 

Kürzlich hochgeladen

CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 

Kürzlich hochgeladen (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 

Cordova training : Day 6 - UI development using Framework7

  • 1. CORDOVA TRAINING SESSION: 6 - USER INTERFACE USING FRAMEWORK7
  • 2. SIDE PANELS  Framework7 supports the use of side panels.  Up to 2 panels, one on left side and another one on right side can be included.  After we add panels we need to choose opening effect for each panel. This can be:  Reveal  Cover
  • 3. SIDE PANELS  A panel consist of 2 components – panel itself and the panel overlay.  The panel overlay is the layer that overlap the screen when a panel is displayed.
  • 4. SIDE PANELS <div class="panel-overlay"></div> <div class="panel panel-left panel-reveal"> Panel content </div> <div class="panel panel-right panel-cover"> Panel content </div>
  • 5. SIDE PANELS  To open panel we need to add "open-panel" class to any HTML element (preferred to link)  To close panel we need to add "close-panel" class to any HTML element (preferred to link)  If you want to specify which panel should opened/closed, then it could be done via additional data-panel="left" attribute on this HTML element.
  • 6. SIDE PANELS  <a href="#" data-panel="left" class="open-panel">Open Left Panel</a>  $$('.open-left-panel').on('click', function (e) { myApp.openPanel('left'); });
  • 7. ALERT  Framework7 provides methods to display alerts.  To open Alert modal we should call one of the following App methods:  alert(text, [title, callbackOk]);  alert(text, [callbackOk]);
  • 8. ALERT  <p><a href="#" class="alert-text">Alert With Text</a></p>  $$('.alert-text').on('click', function () { myApp.alert('Here goes alert text'); });
  • 9. CONFIRM  Confirm modal usually used when it is required to confirm some action.  To open Confirm modal we should also call one of the following App methods:  confirm(text, [title, callbackOk, callbackCancel]);  confirm(text, [callbackOk, callbackCancel]);
  • 10. CONFIRM  <a href="#" class="confirm-ok">Confirm with text and Ok callback</a>  $$('.confirm-ok').on('click', function () { myApp.confirm('Are you sure?', function () { myApp.alert('You clicked Ok button'); }); });
  • 11. PROMPT  Prompt modal used when it is required to get some data/answer from user.  To open Prompt modal we should also call one of the following App methods:  prompt(text, [title, callbackOk, callbackCancel]);  prompt(text, [callbackOk, callbackCancel]);
  • 12. PROMPT  <a href="#" class="prompt-ok">Prompt with text and Ok callback</a>  $$('.prompt-ok').on('click', function () { myApp.prompt('What is your name?', function (value) { myApp.alert('Your name is "' + value + '". You clicked Ok button'); }); });
  • 13. PRELOADER  Preloader Modal is used to indicate some background activity (like Ajax request) and to block any user actions during this activity.  To open Preloader modal we should also call appropriate App method:  showPreloader([title]);  Because Preloader modal has not any buttons, it should be closed by JavaScript using hidePreloader() method.
  • 14. PRELOADER  <a href="#" class="open-preloader">Open Preloader</a>  $$('.open-preloader').on('click', function () { myApp.showPreloader(); setTimeout(function () { myApp.hidePreloader(); }, 2000); });
  • 15. INDICATOR  If we only need to display a loading indicator to denote an ongoing action, we can use the indicator widget. The most commonly used methods are:  showIndicator();  hideIndicator();
  • 16. INDICATOR  <a href="#" class="open-indicator">Open Indicator</a>  $$('.open-indicator').on('click', function () { myApp.showIndicator(); setTimeout(function () { myApp.hideIndicator(); }, 2000); });
  • 17. POPUP  Popup is a popup window with any HTML content that pops up over App's main content.  To create a popup layout, we need to add class="popup“.  To create a full screen popup on tablets, use class=“popup tablet-fullscreen”  To open popup we need to add "open-popup" class to any HTML element (prefered to link)  To close popup we need to add "close-popup" class to any HTML element (prefered to link)
  • 18. POPUP  <a href="#" data-popup=".popup-about" class="open-popup">Open About Pop</a>  <div class="popup popup-about"> <div class="content-block"> <p>About</p> <p><a href="#" class="close-popup">Close popup</a></p> <p>Lorem ipsum dolor ...</p> </div> </div>
  • 19. POPUP  $$('.open-about').on('click', function () { myApp.popup('.popup-about'); });
  • 20. ACTION SHEET  Action Sheet is a slide-up pane for presenting the user with a list of actionable items.  You can also use action sheets to prompt the user to confirm a potentially dangerous action.  Action sheet is the dynamic element, it could be created and opened only using JavaScript.
  • 21. ACTION SHEET  <p><a href="#" class="ac-1">One group, three buttons</a></p>  $$('.ac-1').on('click', function () { var buttons = [ {text: 'Button1', onClick: function (){}}, {text: 'Button2‘, onClick: function (){}}, {text: 'Cancel', onClick: function (){}}, ]; myApp.actions(buttons); });
  • 22. TABS <div class="tabs"> <div class="tab active" id="tab1"></div> <div class="tab active" id="tab2"></div> <div class="tab active" id="tab3"></div> </div>
  • 23. TABS  To switch to a tab, we need to follow the below code pattern:  <a href="#tab1" class="tab-link">Tab 1</a>  <a href="#tab2" class="tab-link">Tab 2</a>
  • 24. LAZY LOADING  Lazy Load is a concept that delays the loading of images on page while they are outside of viewport until user scrolls to them.  This helps to speed up the app loading phase.  This method also improve scrolling performance and also save traffic.
  • 25. LAZY LOADING  To use lazy load on images:  specify image source into data-src attribute instead of src attribute.  add lazy class to image. <img data-src="path/to/image.jpg" class="lazy">
  • 26. LAZY LOADING  To use lazy load on background images:  specify element's background image source into data-background.  add lazy class to image. <img data-background="path/to/image.jpg" class="lazy">
  • 27. LAZY LOADING  If you want to add fade-in effect when image is loaded, you need to add additional lazy-fadein class to image/element. <img data-background="path/to/image.jpg" class="lazy lazy-fadein">