Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you know that you need to go to the second slide when your page loads then you could do something like this:</p> <pre><code>var init = { startingSlide: 1 }; // i.e. second slide, the indices are zero-based $('whatever').cycle($.extend(init, the_name_of_your_global_default_options)); </code></pre> <p>You'd just have to arrange for <code>init</code> to be an empty object literal except when you needed to set <code>startingSlide</code>. If <code>.cycle()</code> is being somewhere outside your page, then you could reserve a variable for page-specific options and <code>$.extend()</code> that where <code>.cycle()</code> is called. For example, in your page, you could do something like this:</p> <pre><code>app_name_space.page_cycle_opts = { startingSlide: 1 }; </code></pre> <p>and then way off in the JavaScript file that is binding the cycle stuff:</p> <pre><code>app_name_space.page_cycle_opts = app_name_space.page_cycle_opts || { }; $('whatever').cycle($.extend(app_name_space.page_cycle_opts, default_options)); </code></pre> <p>I'm using <code>app_name_space</code> as a placeholder for whatever global namespace your application is already using to avoid name conflicts. If you had to deal with multiple cycle instances on a single page then you'd want to index <code>page_cycle_opts</code> by element ID, for example:</p> <pre><code>app_name_space.page_cycle_opts['X'] = { startingSlide: 1 }; </code></pre> <p>and then way off elsewhere:</p> <pre><code>$('whatever').each(function() { $(this).cycle($.extend( app_name_space.page_cycle_opts[this.id] || { }, default_options )); }); </code></pre> <p>The basic idea is to consider the global configuration options as a set of defaults and then allow page-specific overrides through a well defined and documented mechanism.</p> <p>A long winded answer to a long winded question. Hope its clear and not confusing.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload