You are here

function masonry_default_options in Masonry API 7.3

Same name and namespace in other branches
  1. 7 masonry.module \masonry_default_options()
  2. 7.2 masonry.module \masonry_default_options()

Get default Masonry options.

Return value

An associative array of default options for Masonry. Contains:

  • masonry_column_width: The width of each column (in pixels or as a percentage).
  • masonry_column_width_units: The units to use for the column width ('px' or '%').
  • masonry_gutter_width: The spacing between each column (in pixels).
  • masonry_resizable: Automatically rearrange items when the container is resized.
  • masonry_animated: Animate item rearrangements.
  • masonry_animation_duration: The duration of animations (in milliseconds).
  • masonry_fit_width: Sets the width of the container to the nearest column. Ideal for centering Masonry layouts.
  • masonry_rtl: Display items from right-to-left.
  • masonry_images_first: Load all images first before triggering Masonry.
1 call to masonry_default_options()
masonry_apply in ./masonry.module
Apply Masonry to a container.

File

./masonry.module, line 103
Provides an API for integrating the jQuery Masonry plugin with Drupal.

Code

function masonry_default_options() {
  $options = array(
    'masonry_column_width' => '',
    'masonry_column_width_units' => 'px',
    'masonry_gutter_width' => '0',
    'masonry_resizable' => 1,
    'masonry_animated' => 0,
    'masonry_animation_duration' => '500',
    'masonry_fit_width' => 0,
    'masonry_rtl' => 0,
    'masonry_images_first' => 1,
    'masonry_stamp_selector' => '',
    'masonry_percent_position' => 0,
  );

  // Allow other modules to alter the default options
  drupal_alter('masonry_default_options', $options);
  return $options;
}