Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable/disable plax few times ipad/iphone stop working #52

Open
senerdude opened this issue Nov 26, 2013 · 3 comments
Open

enable/disable plax few times ipad/iphone stop working #52

senerdude opened this issue Nov 26, 2013 · 3 comments

Comments

@senerdude
Copy link

I have 6 diffrent div, every div has 4 png. this divs in a slider. when slider init I'm enabling plax on number 1 div. when I slide to another div disable number 1 div and activate second div's plax. its working fine. but in ipad or iphone after few times disable/enable parallax stop working.

here is sample two function when change slide. Am I doing wrong?

thank you

function initSlideOne() {
$.plax.disable({ "clearLayers": true, "restorePositions": true });
$("#SlideOne img.layer1").plaxify({ "xRange": 0 });
$("#SlideOne img.layer2").plaxify({ "xRange": 100 });
$("#SlideOne img.layer3").plaxify({ "xRange": 130 });
$("#SlideOne img.layer4").plaxify({ "xRange": 100, "invert": true });
$("#SlideOne img.layer5").plaxify({ "xRange": 200, "invert": true });
$.plax.enable({ "activityTarget": $('#SlideOne') });
}

function initSlideTwo() {
$.plax.disable({ "clearLayers": true, "restorePositions": true });
$("#SlideTwo img.layer1").plaxify({ "xRange": 0 });
$("#SlideTwo img.layer2").plaxify({ "xRange": 100 });
$("#SlideTwo img.layer3").plaxify({ "xRange": 130 });
$("#SlideTwoe img.layer4").plaxify({ "xRange": 100, "invert": true });
$("#SlideTwo img.layer5").plaxify({ "xRange": 200, "invert": true });
$.plax.enable({ "activityTarget": $('#SlideTwo') });
}

@magebarf
Copy link
Contributor

Not able to reproduce on iPhone, iOS 7.0.4... I've tried enabling/disabling about 20 times without it stopping to work...
How frequent does this happen on your end? Every second time? Every 50th time?

Two differences in how I use it compared to the sample you give;

  • I do not use a activityTarget for enable.
  • Each img element has data-xrange, data-yrange, and data-invert attributes and a specific class for "tagging". Then I simply do $('.PlaxLayer', '#SlideOne').plaxify() to apply to all elements at the same time, instead of calling .plaxify once for each element.

Otherwise I use it pretty much identical to your approach.

@senerdude
Copy link
Author

you can test from : http://pureservice.me/PlaxTest.html

I noticed (iphone5-ios7) plax working first load and rotation. I just touched screen and it stops working. tryed again continue to work.. after I clicked emty links on the page (it return false) stop worked again. something intturped code but I'm not sure what it is.

I'm optimizing my codes, I will send you when I finis it.. you can see oter screens.

thank you

@senerdude
Copy link
Author

its only stop in IOS. in android we tryed everyting still continue to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants