zurb foundation 5.4 joyride - control expose cover

613 Views Asked by At

Can someone explain to me how to control the expose-cover for zurb foundation? If I understand correctly the expose-cover is the grey background overlay that shows up behind the joyride modal.

I have a couple tips not bound to anything and then i have some bound to some ids using the data-id attribute. I expect that when i get to the tips with data-id the expose cover disappears. Instead, it remains.

What am I doing wrong?

<ol class="joyride-list" data-joyride >
    <li data-button="Next" data-options="prev_button:false;"><p></p>
    </li>

    <li data-button="Next" data-prev-text="Prev">
        <p></p>
    </li>

    <li data-button="Next" data-prev-text="Prev">
        <p></p>
    </li>

    <li data-id="next_article_btn" data-button="Next" data-prev-text="Prev" data-options="expose:false; modal:false;">
        <p></p>
    </li>

    <li data-id="prev_article_btn" data-button="Next" data-prev-text="Prev" data-options="expose:false; modal:false;">
        <p></p>
    </li>

    <li data-id="to_top_btn" data-button="Finish" data-prev-text="Prev" data-options="expose:false;">
        <p></p>
    </li>
</ol>
3

There are 3 best solutions below

0
On

I don't think the current joyride foundation integration let you change the expose option individually. You can only enable/disable it for the whole joyride.

   $(document).foundation({
     joyride: {
       expose: true
     }
   }).foundation('joyride', 'start');
0
On

Based on lepop answer, what you could do is use another modal-bg that you could control as you wish

<div class="reveal-modal-bg" style="opacity:0.8;"></div>
<div class="joyride-modal-bg" style="opacity:0;"></div>

and

pre_ride_callback: 
    function () { 
        setTimeout(function () { 
            $(".reveal-modal-bg").css("display", "block").css("z-index", "100");
        }
    , 150); }
,post_ride_callback: 
    function () { 
        setTimeout(function () {
            $(".reveal-modal-bg").css("display", "none").css("z-index", "1004"); 
        }
    , 5); 
    }

Complete code is:

<div class="reveal-modal-bg" style="opacity:0.8;"></div>
<div class="joyride-modal-bg" style="opacity:0;"></div>

$(document).foundation({
                    joyride: {
                        cookie_monster: false,
                        expose: true,
                        modal: true,
                        pre_ride_callback: function () { setTimeout(function () { $(".reveal-modal-bg").css("display", "block").css("z-index", "100"); }, 150); },
                        post_ride_callback: function () { setTimeout(function () { $(".reveal-modal-bg").css("display", "none").css("z-index", "1004"); }, 5); }
                    }
                }).foundation('joyride', 'start');

modal: true and expose: true are required

0
On

i found no solution but this

$(document).foundation({offcanvas: {close_on_click: false}, reveal: {close_on_esc: true, close_on_background_click: true}, joyride: {cookie_monster: false, expose: true, modal: true, post_expose_callback: function () { setTimeout(function () { $(".joyride-modal-bg").css("display", "block"); },5); }}}).foundation('joyride', 'start');