javascript - Can I Add an Array to PortfolioJS to Use More Galleries? -


i used portfoliojs.com horizontal photography galleries on website meetanthony.com.

the galleries work on imac, not on iphones, ipads, , other devices.

strangely, first gallery worked on phone. swipe 1 finger see photos end of gallery.

the problem

galleries 2-6 didn't swipe on mobile devices. after few moments, swipe images 2 fingers. took few minutes.

i want photography galleries scroll on computer , swipe (one finger) on mobile devices.

the solution?

i think portfoliojs javascript using id "#gallery". think javascript did not support 6 galleries when added more id's (#gallery-2, #gallery-3, etc.).

so changed first gallery id "#gallery" "#gallery-1". used "var gallery" create array 6 gallery id's. don't know if works yet. don't have iphone, ipad, or mobile device.

included in head:

<script> $(document).ready(function() {     var p = $("#gallery-1, #gallery-2, #gallery-3, #gallery-4, #gallery-5, #gallery-6").portfolio({         logger: true,         loop: false,         autoplay: false,         height: "540px",         width: "100%",         enablekeyboardnavigation: false,         lightbox: false,         showarrows: false      });     p.init(); }); </script> 

included in linked js:

// local variables var gallery = new array("#gallery-1", "#gallery-2", "#gallery-3", "#gallery-4", "#gallery-5", "#gallery-6");  var portfolio = this, gallery = 

http://meetanthony.com/script/portfolio.js
meetanthony.com/script/portfolio.pack.min.js

can let me know if adding array portfoliojs answer?

thank help!

you can use 1 portfolio multiple galleries this

<section class="wrapper" >   <div id="gallery">....</div>                                                                             <div id="gallery1" style="display:none">.....</div>   <div id="gallery2" style="display:none">.....</div>   <div id="gallery3" style="display:none">.....</div>   <div id="gallery4" style="display:none">.....</div> </section> 

then in script

 $("#gallery").html($('#gallery1').html()) //for instance   var p = $("#gallery").portfolio();  p.init(); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -