Skip to content

Instantly share code, notes, and snippets.

@jlleblanc
Last active December 12, 2015 04:08
Show Gist options
  • Save jlleblanc/4711521 to your computer and use it in GitHub Desktop.
Save jlleblanc/4711521 to your computer and use it in GitHub Desktop.
<?php
$options = array(
'loop' => false,
'autoSlide' => true,
'dispItems' => 3,
// continue this array with everything you want to set
);
// Unfortunately, slider_options does become a JS global, but you can cut down on that
// by using one global and setting many properties. I'm just doing slider_options to keep
// this example succinct.
$doc->addScriptDeclaration('var slider_options = ' . json_encode($options));
$doc->addScript(JURI::base(TRUE) . '/modules/mod_yatm/tmpl/js/jquery.carousel.min.js');
$doc->addScript(JURI::base(TRUE) . '/modules/mod_yatm/tmpl/js/script.where.you.use.slider_options.js');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment