As mentioned in my previous pull requests, I did notice that Ender (Jeesh) support is currently broken.
I've noticed a few places where things are not working as intended, and I thought I'd outline them here;
Jeesh (Bonzo) does not have a position method. This is currently being used to initialize the starting positions for each layer. One could calculate the same by using the offsetLeft and offsetTop, but as this does not take margin parameters into considerations (unlike jQuery's .position()) it would have to be retrieved and parsed from the css attributes. Currently, the single line var position = layer.obj.position() would be replaced with the following block;
var marginLeft = layer.obj.css('margin-left') || '0px'
var marginTop = layer.obj.css('margin-top') || '0px'
marginLeft = marginLeft.match(/^((-?\d+)\s*px|0+\s*%|left)$/)
marginTop = marginTop.match(/^((-?\d+)\s*px|0+\s*%|top)$/)
marginLeft = marginLeft ? parseFloat(marginLeft[2]) : 0
marginTop = marginTop ? parseFloat(marginTop[2]) : 0
// Figure out where the element is positioned, then reposition it from the top/left
var position = { left : this.offsetLeft - marginLeft, top : this.offsetTop - marginTop }
Jeesh does not handle calling .width() on the window or document objects properly. This makes all the examples where the activity target is not set to an explicit element throw errors (at least running chrome). A workaround would simply be setting the activity target to the body element, but that would give a very small area and odd behavior if one tries to apply it to the examples.
Jeesh's (Bonzo's) offset() has the same issue as listed above, it does not take margin into consideration, at least not when it is set explicitly. This makes the specific element example, where the parallax box has a top margin of 100px and a left margin of auto, act very weird. The parallax effect is triggered whenever moving your mouse pointer above the box, down to 100px from the bottom of it, where the effect stops.
All in all, the issues with running Plax with Ender / Jeesh / Bonzo instead of jQuery could be fixed, but I believe that there at least needs to be a few fixes incorporated in Bonzo and the Ender Bridge before it would be worth the time.
My suggestion is to currently remove Ender from the documentation, only promising compatibility with jQuery, while I open up some issues with the Bonzo project instead, and then consider adding it back in the future.
As mentioned in my previous pull requests, I did notice that Ender (Jeesh) support is currently broken.
I've noticed a few places where things are not working as intended, and I thought I'd outline them here;
var position = layer.obj.position()
would be replaced with the following block;All in all, the issues with running Plax with Ender / Jeesh / Bonzo instead of jQuery could be fixed, but I believe that there at least needs to be a few fixes incorporated in Bonzo and the Ender Bridge before it would be worth the time.
My suggestion is to currently remove Ender from the documentation, only promising compatibility with jQuery, while I open up some issues with the Bonzo project instead, and then consider adding it back in the future.