Jump to content

[SOLVED] Fancybox for CMS, Prestashop 8.2


Reeder

Recommended Posts

To add the fancybox plugin to PS 8.2 I used this article: https://mypresta.eu/prestashop-17/cms-page-fancybox-gallery.html

Fancybox opens, but the buttons (controls left / right) are not displayed.

I then proceeded as follows and tried to extend the startup script, but nothing works correctly and the controls buttons are not displayed:

example#1:

jQuery(document).ready(function() {
   jQuery('a.fancybx').fancybox({
        openEffect      : 'elastic',
        closeEffect     : 'elastic',
        nextEffect      : 'easeOutBack',
        prevEffect      : 'easeInBack',
        overlayShow   :   'true',
        cyclic    :   'false',
        showNavArrows :   'true'
    })
});  

 

example#2:

$(document).ready(function() {
   $('a.fancybx').fancybox({
        openEffect      : 'elastic',
        closeEffect     : 'elastic',
        nextEffect      : 'easeOutBack',
        prevEffect      : 'easeInBack',
        overlayShow   :   'true',
        cyclic    :   'false',
        showNavArrows :   'true'
    })
});  

 

example#3:

document.addEventListener("DOMContentLoaded", function (event) {

 $("a.fancybox").fancybox();

});

 

example#4:

document.addEventListener("DOMContentLoaded", function (event) {

 $("a.fancybox").fancybox({
        openEffect      : 'elastic',
        closeEffect     : 'elastic',
        nextEffect      : 'easeOutBack',
        prevEffect      : 'easeInBack',
        overlayShow   :   'true',
        cyclic    :   'false',
        showNavArrows :   'true'
    });

});

 

All these scripts open fancybox, but the navigation arrows are missing and I always scroll to the top of the web page. I've already tried a lot of things, I also added the rel="" tag and I don't know if I should use any other tags, but I rather think that there is an error somewhere in the script.

 


Don't you know any practical tips?

Thank you very much and have a nice day.
Peter

 

Edited by Reeder (see edit history)
Link to comment
Share on other sites

Hi,

yes I see the CSS in the PS 8.2 header, like this:

<link rel="stylesheet" href="https://jezdecka-staj.cz/js/jquery/plugins/fancybox/jquery.fancybox.css" type="text/css" media="all">

 

 

Link to comment
Share on other sites

I tried this examples:

-----example 1----

document.addEventListener("DOMContentLoaded", function (event) {
 $("a.fancybox").fancybox({
        "arrows" :   1
    });
});

 

----example 2----

document.addEventListener("DOMContentLoaded", function (event) {
 $("a.fancybox").fancybox({
        arrows :   'true'
    });
});

 

-----example 3 ---------

document.addEventListener("DOMContentLoaded", function (event) {
 $("a.fancybox").fancybox({
        arrows :   '1'
    });
});

 

Fancybox opens, but the left/right buttons are not there...
The strange thing is that when I open it, it scrolls the page to the top.. which fancybox doesn't do by default...

Can't those buttons be disabled somewhere?

 

 

Link to comment
Share on other sites

Just now, Reeder said:

I tried this examples:

-----example 1----

document.addEventListener("DOMContentLoaded", function (event) {
 $("a.fancybox").fancybox({
        "arrows" :   1
    });
});

 

----example 2----

document.addEventListener("DOMContentLoaded", function (event) {
 $("a.fancybox").fancybox({
        arrows :   'true'
    });
});

 

-----example 3 ---------

document.addEventListener("DOMContentLoaded", function (event) {
 $("a.fancybox").fancybox({
        arrows :   '1'
    });
});

 

Fancybox opens, but the left/right buttons are not there...
The strange thing is that when I open it, it scrolls the page to the top.. which fancybox doesn't do by default...

Can't those buttons be disabled somewhere?

 

2 minutes ago, Reeder said:

I tried this examples:

-----example 1----

document.addEventListener("DOMContentLoaded", function (event) {
 $("a.fancybox").fancybox({
        "arrows" :   1
    });
});

 

----example 2----

document.addEventListener("DOMContentLoaded", function (event) {
 $("a.fancybox").fancybox({
        arrows :   'true'
    });
});

 

-----example 3 ---------

document.addEventListener("DOMContentLoaded", function (event) {
 $("a.fancybox").fancybox({
        arrows :   '1'
    });
});

 

Fancybox opens, but the left/right buttons are not there...
The strange thing is that when I open it, it scrolls the page to the top.. which fancybox doesn't do by default...

Can't those buttons be disabled somewhere?

 

 

I tried this tutorial on PS 1.7 and it works there too without buttons and scrolls the page to the top...

 

Link to comment
Share on other sites

Got it! 🤠

and adding the attribute rel="yourRel" to all <a> links, like this

Thanks for your help and effort Knowband Plugins & Prestashop Addict

Link to comment
Share on other sites

  • Reeder changed the title to [SOLVED] Fancybox for CMS, Prestashop 8.2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...