- Framework7 Tutorial
- Framework7 - Home
- Framework7 - Overview
- Framework7 - Environment
- Framework7 Components
- Framework7 - Layouts
- Framework7 - Navbars
- Framework7 - Toolbars
- Framework7 - Search Bar
- Framework7 - Status Bar
- Framework7 - Side Panels
- Framework7 - Content Block
- Framework7 - Layout Grid
- Framework7 - Overlays
- Framework7 - Preloaders
- Framework7 - Progress Bar
- Framework7 - List Views
- Framework7 - Accordion
- Framework7 - Cards
- Framework7 - Chips
- Framework7 - Buttons
- Framework7 - Action Button
- Framework7 - Forms
- Framework7 - Tabs
- Framework7 - Swiper Slider
- Framework7 - Photo Browser
- Framework7 - Autocomplete
- Framework7 - Picker
- Framework7 - Calendar
- Framework7 - Refresh
- Framework7 - Infinite Scroll
- Framework7 - Messages
- Framework7 - Message Bar
- Framework7 - Notifications
- Framework7 - Lazy Load
- Framework7 Styling
- Framework7 - Color Themes
- Framework7 - Hairlines
- Framework7 Templates
- Framework7 - Templates Overview
- Framework7 - Auto Compilation
- Framework7 - Template7 Pages
- Framework7 Fast Clicks
- Framework7 - Active State
- Framework7 - Tap Hold Event
- Framework7 - Touch Ripple
- Framework7 Useful Resources
- Framework7 - Quick Guide
- Framework7 - Useful Resources
- Framework7 - Discussion
Framework7 - Photo Browser Templates
Description
Framework7 provides you many photo browser templates, which you can pass on to the photo browser initialization.
Navbar Template
The following code shows an example of navbar template, which you can pass in navbarTemplate parameter −
<div class = "navbar"> <div class = "navbar-inner"> <div class = "left sliding"> <a href = "#" class = "link close-popup photo-browser-close-link {{#unless backLinkText}}icon-only{{/unless}} {{js "this.type = = = \'page\' ? \'back\' : \'\'"}}"> <i class = "icon icon-back {{iconsColorClass}}"></i> {{#if backLinkText}}<span>{{backLinkText}}</span>{{/if}} </a> </div> <div class = "center sliding"> <span class = "photo-browser-current"></span> <span class = "photo-browser-of">{{ofText}}</span> <span class = "photo-browser-total"></span> </div> <div class = "right"></div> </div> </div>
The above template uses classes, which are listed below −
<a class = "photo-browser-close-link"> − This link will close the photo browser on click. Not only does it close the popup or the page, but it also detaches all events listeners.
<span class = "photo-browser-current"> − The photo browser will put the index number currently active slide into element with class photo-browser-current.
<span class = "photo-browser-total"> − The photo browser will put the total number of images into the element with class photo-browser-total.
Toolbar Template
The following code shows an example of the toolbar template, which you can pass in toolbarTemplate parameter −
<div class = "toolbar tabbar"> <div class = "toolbar-inner"> <a href = "#" class = "link photo-browser-prev"> <i class = "icon icon-prev {{iconsColorClass}}"></i> </a> <a href = "#" class = "link photo-browser-next"> <i class = "icon icon-next {{iconsColorClass}}"></i> </a> </div> </div>
The above given template uses classes which are listed below −
<a class = "photo-browser-next"> − It works like the Next button.
<a class = "photo-browser-prev"> − It works like the Previous button.
Photo Element Template
The following code shows the template example of single photo slide element, which you can pass in photoTemplate parameter −
<div class = "photo-browser-slide swiper-slide"> <span class = "photo-browser-zoom-container"> <img src = "{{js "this.url || this"}}"> </span> </div>
Lazy Photo Element Template
The following code shows the template example of single photo slide element, which you can pass in lazyPhotoTemplate parameter −
<div class = "photo-browser-slide photo-browser-slide-lazy swiper-slide"> <div class = "preloader {{@root.preloaderColorClass}}"> {{#if @root.material}} {{@root.materialPreloaderSvg}} {{/if}} </div> <span class = "photo-browser-zoom-container"> <img data-src = "{{js "this.url || this"}}" class = "swiper-lazy"> </span> </div>
Object Element Template
The following code shows the template example of single photo slide element, which you can pass in objectTemplate parameter −
<div class = "photo-browser-slide photo-browser-object-slide swiper-slide"> {{js "this.html || this"}} </div>
Single Caption Template
The following code shows the template example of single caption element, which you can pass in captionTemplate parameter −
<div class = "photo-browser-caption" data-caption-index = "{{@index}}"> {{caption}} </div>