• Resolved nilskdc

    (@nilskdc)


    Hy Simon
    My slides are not showing after an update from 1.6.2.
    I updated the slides.
    I have no CDN cache.
    Doing ctrl+shift+J I get the following error :
    TypeError: a(…).find(…).addBack is not a function

    I don’t know how to proceed from ther
    Could you give it a look ?

    web page with the slide show is
    https://nilskuhndechizelle.com/quizz1/

    Furthermore, I had a script for slow scrolling incorporated in my slides wich does not seem to be compatible with the 2.0 SA (as with that script, no slides appear even on the “preview slider”). So I removed it to start with in order to debug one problem at a time.

    I am a bit afraid to loose my html+css slide show, wich I had a hard time putting up on your initial version of SA !

    Thanks for your help!
    Nils

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter nilskdc

    (@nilskdc)

    Oh and I forgot to mention : I also tried to disable all other plugins to check for owl slider incompatibilities but with no result

    Plugin Author simonpedge

    (@simonpedge)

    Hi, this is very strange, and has me scratching my head.

    I’m not seeing the JavaScript error you are seeing:
    TypeError: a(…).find(…).addBack is not a function
    (I am not seeing any JavaScript errors)

    Viewing the source code, I see the correct .js and .css files being loaded, and I can see the JavaScript source code being generated for your slider, but the normal Owl Carousel wrappers (‘owl-stage-outer’, ‘owl-stage’ and ‘owl-item’) are missing, which is something I’ve not seen before.

    Are you building the page using a Page Builder? If so, add the slider to a test page built not using the page builder to see what happens.

    What happens when you create a new slider from scratch (containing some dummy content)? I wondering if some slide content within your existing slides is clashing with the new version of Owl Carousel.

    If need be I may have to log into your site to investigate further, and you can use the contact form on my site (https://edgewebpages.com/) to send me a private message with your details.

    Thread Starter nilskdc

    (@nilskdc)

    Hi,
    I am not using a Page Builder and yes, I already tried creating a new slider from scratch but still nothing appears
    I just sent you a contact form, and truly appreciate your help
    Nils

    I had the same issue and I needed to carousel to work asap.

    If your issue is the same as mine, then that your jquery is called at the footer.. Which is correct from optimization point of view, but sadly a limitation for calling javascript directly from shortcode function.

    As loading jquery in the footer will cause
    if (wp_script_is('jquery', 'done'))
    to false (as shortcode code is executed earlier than jquery called) and code required to start carousel would not be added to page.

    Now, what moving your jquery could be a plugin (cache/minify) that you need to check, or like in my case – template.

    Look up in your in functions.php for something like:

    remove_action('wp_head', 'wp_enqueue_scripts', 1);
    add_action('wp_footer', 'wp_enqueue_scripts', 5);

    and uncomment it.

    Hope that will solve for you.

    • This reply was modified 7 years, 3 months ago by Maximus Light. Reason: cleaning
    Plugin Author simonpedge

    (@simonpedge)

    Thanks for the feedback Maximus.

    This was in fact the problem – in functions.php (Nils gave me access to his site) there was the following code:

    if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
    function my_jquery_enqueue() {
       wp_deregister_script('jquery');
       wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
       wp_enqueue_script('jquery');
    }

    I commented out the line:
    //if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);

    And this sorted the problem out.
    (shouldn’t be loading jQuery from an external source anyways, since it is bundled with WP…)

    Thread Starter nilskdc

    (@nilskdc)

    That did the job, thank you so much Simon and Maximus
    If I understand correctly, I can delete the whole set of lines so that jquery doesn’t get loaded from an external source (just tried that, and everything seems to be working fine) :

    if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
    function my_jquery_enqueue() {
       wp_deregister_script('jquery');
       wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
       wp_enqueue_script('jquery');
    }

    The only thing that is not functioning anymore is a script for smooth scrolling on hover I had put on the slides and on various other pages :

    <p><script>
    $(function() {
    	// code from https://css-tricks.com/snippets/jquery/smooth-scrolling/
      $('a[href*=#]:not([href=#])').click(function() {
        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
          var target = $(this.hash);
          target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
          if (target.length) {
          // stops scrolling  
        $('html,body').on("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove", function(){
           $('html,body').stop();
        });
    	// change top-x to create the additional off set and following number to specify scroll delay       
            $('html,body').animate({
              scrollTop: target.offset().top-20
            }, 600);
            return false;
          }
        }
      });
    });
    </script></p>

    If I put this script back on the slides, they disappear once again. And on the other pages where the script is present, it is not functioning anymore. Certainly has to do with the wrong way I use jquery, as you two pointed out (not being a developer, I tend to cut and paste what I find on the net ;-). I will try to figure out. If you have any advice, I’d be glad to hear

    Thanks once again, happy to find my slides back ??

    Plugin Author simonpedge

    (@simonpedge)

    Ok, I’m marking this topic as resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘slides not showing after 2.0 update’ is closed to new replies.