Revealing a Modal in Foundation 4

前端 未结 4 1294
温柔的废话
温柔的废话 2021-01-15 03:24

How do you Reveal a modal programmatically in Foundation 4?

In Foundation 3 we had the easy to use reveal() method.

What can you use in Foundation 4? Please

4条回答
  •  离开以前
    2021-01-15 03:54

    For programmatic (javascript) access the docs seem to only suggest launching via click event.

    Add your Modal:

    Awesome. I have it.

    Your couch. It is mine.

    Im a cool paragraph that lives inside of an even cooler modal. Wins

    ×

    Set the trigger:

    Click Me For A Modal
    

    Activate trigger programmatically:

    $('#my-trigger').trigger('click');
    

    Admittedly it does seem like a work-around, maybe this is due to their heightened "lightweight/mobile-first" focus. Lets see what the next release brings.

提交回复
热议问题