Skip to content

Like using Android's ViewPager to swipe between WebViews: but in HTML5 instead using IFrames

Notifications You must be signed in to change notification settings

UstadMobile/IFramePager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IFramePager

This is a touch swiper script that allows the user to swipe from iframe to iframe. Most touch swipe scripts dont support this because the event handlers need to be tied to the iframe body

Use like so:

var testEl = document.getElementById("carouselcontainer"); var iframePager = new IFramePager(testEl, { urls: ["assets/jqm-frame0.html", "assets/frame1.html", "assets/frame2.html", "assets/frame3.html"], threshold: 20 });

setTimeout(function() { iframePager.go(1); }, 2000);//go to the next page after 1 second

Where carouselcontainer is a relatively positioned div that will container the swiper. Threshold is the minimum horizontal distance in pixels needed for a swipe to be triggered urls is an array of pages to use as the iframe sources

About

Like using Android's ViewPager to swipe between WebViews: but in HTML5 instead using IFrames

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published