Create a swipe between pages with CSS and JQuery -
i'm trying mock smartphone swipe navigation in html+css+jquery. i'm setting few iframes includes html pages , swipe between them navigation menu. that's nice, want swipe activated buttons inside iframes (the "back menu" buttons on example)
this did far: example
the code used create swipe effect is:
jquery:
$(document).ready(function() { $('#slide1_controls').on('click', 'button', function(){ $("#slide1_images").css("transform","translatex("+($(this).index()-2) * -475+"px)"); }); });
can buttons inside iframes?
note: in each page i'll have inside swipe effect well: implemented swiping between divs , not iframes, changing given iframes divs won't work.
you can turn wrote function, , call function inside iframe.
//// on parent page function slidepage(){ // slide logic goes here } //// inside iframe $('#slide-control').on('click', function(){ window.parent.slidepage() });
note iframe , site must have same domain work.
Comments
Post a Comment