Joyride - while cookie_monster: true nothing works

Working with Foundation is very simple, but I can't figure out what to do in this case. I worked a lot through Google. I tested about 6 different approaches, how to run joyride only once, first visit my page. The result of these approaches has always been different, the slider has multiplied (God knows why), a blank page or just nothing has changed.

If I understand well, I have to set "foundation.joyride.js" in this part monster_cookie: true, BUT after this joyride does not start even once, if cookie_monster: falseI can see joyride every time the main / auxiliary pages are loaded. I tried to clear memory and other simple things, but nothing works. Do you have any working / tested solution?

I have version 5.0.0 of the joyride version, when I pasted the code for version: 5.2.1 joyride stopped working.

I use Foundation as a Wordpress theme, so here is part of my functions.php:

if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);

function my_jquery_enqueue() {

    //Load jQuery 2.0

    wp_deregister_script('jquery');
    wp_register_script('jquery', "http".($_SERVER['SERVER_PORT'] == 443 ? "s" : "")."://code.jquery.com/jquery-2.1.0.min.js", false, null);
    wp_enqueue_script('jquery');

    //Load Foundation.js
    wp_enqueue_script('foundation_js', get_template_directory_uri().'/js/foundation.js', array('jquery'), false, true);
    //Load faq-crm.js
    wp_enqueue_script('faq-crm_js', get_template_directory_uri().'/js/faq-crm.js', array('jquery', 'foundation_js'), false, true);
    //modernizr.js
    wp_enqueue_script('modernizr_js', get_template_directory_uri().'/js/vendor/modernizr.js', array('jquery', 'foundation_js', 'faq-crm_js'), false, true);
    // Load slider orbit.js
    wp_enqueue_script('orbit_slider_js', get_template_directory_uri().'/js/foundation/foundation.orbit.js', array('jquery', 'foundation_js', 'faq-crm_js'), false, true);
    // Load magellan.js 
    wp_enqueue_script('magellan_js', get_template_directory_uri().'/js/foundation/foundation.magellan.js', array('jquery', 'foundation_js', 'faq-crm_js'), false, true);
    //Load topbar.js
    wp_enqueue_script('topbar_js', get_template_directory_uri().'/js/foundation/foundation.topbar.js', array('jquery', 'foundation_js', 'faq-crm_js'), false, true);
    //Load modal.js
    wp_enqueue_script('modal_js', get_template_directory_uri().'/js/foundation/foundation.reveal.js', array('jquery', 'foundation_js', 'faq-crm_js'), false, true);
    //Load joyride.js
    wp_enqueue_script('joyride_js', get_template_directory_uri().'/js/foundation/foundation.joyride.js', array('jquery', 'foundation_js', 'faq-crm_js'), false, true);
    //Load cookie.js
    wp_enqueue_script('cookie_js', get_template_directory_uri().'/js/vendor/jquery.cookie.js', array('jquery', 'foundation_js', 'faq-crm_js'), false, true);
}
+4
source share
1 answer

I'm not sure if you are using the correct options. I used Zurb Joyride in the project and just configured the cookie setting inside the joyride function call options as follows:

<script>
$(window).load(function() {
    $('#contentID').joyride({
        'cookieMonster': true,    // true/false for whether cookies are used
        'cookieName': 'JoyRide',  // choose your own cookie name
    });
  });
});
</script>

The basics of setting this option and the options available here are: http://zurb.com/playground/jquery-joyride-feature-tour-plugin

0
source

Source: https://habr.com/ru/post/1533936/


All Articles