Skip to content

Instantly share code, notes, and snippets.

@flashvnn
Created February 20, 2014 08:08
Show Gist options
  • Save flashvnn/9108902 to your computer and use it in GitHub Desktop.
Save flashvnn/9108902 to your computer and use it in GitHub Desktop.
Cycle2 ZM Template
$preset = new stdClass();
$preset->disabled = FALSE; /* Edit this to true to make a default preset disabled initially */
$preset->api_version = 1;
$preset->name = 'jquery_cycle2';
$preset->title = 'JQuery Cycle2';
$preset->html = '<div class="cycle-slideshow"
data-cycle-fx=scrollHorz
data-cycle-timeout=2000
>
<!-- empty element for caption -->
<div class="cycle-caption"></div>
{{#data}}<img src="{{image}}">{{/data}}
</div>';
$preset->css = '';
$preset->ext_css = 'http://jquery.malsup.com/cycle2/demo/demo-slideshow.css';
$preset->ext_js = 'http://malsup.github.io/jquery.cycle2.js';
$preset->html_compiled = '<?php return function ($in) {
$cx = Array(
\'flags\' => Array(
\'jstrue\' => false,
\'jsobj\' => false,
),
\'scopes\' => Array($in),
\'path\' => Array(),
);
ob_start();echo \'<div class="cycle-slideshow"
data-cycle-fx=scrollHorz
data-cycle-timeout=2000
>
<!-- empty element for caption -->
<div class="cycle-caption"></div>
\',LCRun::sec(\'data\', $cx, $in, false, function($cx, $in) {echo \'<img src="\',htmlentities($in[\'image\'], ENT_QUOTES),\'">\';}),\'
</div>\';return ob_get_clean();
}
?>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment