You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
First of all, thanks so much for this awesome plugin. (Im really sad about the support ending).
This is not realy an issue but I have try to run plax with Turbolinks.
I cant find any explanation of how to do it.
So I found it myself and I want to post the solution here :3
( function() {
Turbolinks.start();
var ready = function()
{
console.log( "🦄 TurboLinks Ready -> " + window.location.href + " width: " + $(window).width());
// PLAX
if( $('.yourPlaxSelector').length )
{
$('.yourPlaxSelector').plaxify();
$.plax.enable();
}
}
var cache = function()
{
console.log( "🦄 TurboLinks CacheLoad" );
// Allow plax function `inViewport` to worck properly.
// Without it Plax will only worck on the first call of `ready`.
$.plax.disable( { "clearLayers": true } );
}
// Turbolink tracker
var change = function()
{
console.log( "🦄 TurboLinks Change" );
window['referer'] = window.location.href;
}
ready();
document.addEventListener("turbolinks:before-cache", cache);
document.addEventListener("turbolinks:load", ready);
document.addEventListener("page:change", change);
} )( jQuery );
The text was updated successfully, but these errors were encountered:
Golgarud
changed the title
Plax + Turbolinks [ It worcks]
Plax + Turbolinks [It worcks]
Jan 19, 2018
Hello,
First of all, thanks so much for this awesome plugin.
(Im really sad about the support ending).
This is not realy an issue but I have try to run plax with Turbolinks.
I cant find any explanation of how to do it.
So I found it myself and I want to post the solution here :3
The text was updated successfully, but these errors were encountered: