Gibson
Gibson

Reputation: 2085

How to pass options to Reveal Modal - Foundation - Rails

I've installed Foundation through Rails Gem, but I don't know how to pass options to Reveal Modal in order to change animation speed.

This is what I see in Foundations docs:

{
  animation: 'fadeAndPop',
  animation_speed: 250,
  close_on_background_click: true,
  dismiss_modal_class: 'close-reveal-modal',
  bg_class: 'reveal-modal-bg',
  root_element: 'body',
  bg : $('.reveal-modal-bg'),
  css : {
    open : {
      'opacity': 0,
      'visibility': 'visible',
      'display' : 'block'
    },
    close : {
      'opacity': 1,
      'visibility': 'hidden',
      'display': 'none'
    }
  }
}

This is what I have in my Application.js file

$(function(){ $(document).foundation(); });

Upvotes: 0

Views: 906

Answers (1)

Jorgeuos
Jorgeuos

Reputation: 541

a little late but hope this helps. From Foundation Docs:

"You can configure multiple libraries within the same call as well. Here are a few ways to make it happen:"

$(document).foundation({
    reveal : {
        animation_speed: 500
    },
    tooltip : {
        disable_for_touch: true
    },
    topbar : {
        custom_back_text: false,
        is_hover: false,
        mobile_show_parent_link: true
    }
});

JavaScript Setup

Upvotes: 2

Related Questions