Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As i promissed i made for you a jQuery plugin, try it. It will work just like this:</p> <p>call on document ready: <code>$( '.img-wrap' ).imgSlider({ next: '.next_button', prev: 'previous_button' });</code> or you can edit it in the code where plugin extending options.</p> <p><strong>next</strong> and <strong>prev</strong> option is to define yours navigation buttons. Enjoy. ;)</p> <p>Result you can test here: <a href="http://jsfiddle.net/GomatoX/GKkRM/" rel="nofollow">http://jsfiddle.net/GomatoX/GKkRM/</a></p> <pre class="lang-js prettyprint-override"><code> (function($){ $.fn.imgSlider = function( options ){ o = $.extend({ next: '#next_button', prev: '#previous_button' }, options); var thisCallback = this; $( this ).find( 'img' ).each(function(){ $( this ).hide(); }); $( this ).find( 'img' ).first().addClass( 'active' ).show(); $( o.prev ).hide(); // binding event next $( o.next ).bind( 'click' ,function(){ var nextImg = $( thisCallback ).find( '.active' ).next(); if ( nextImg.length == 0 ) { return false; } $( o.prev ).show(); $( thisCallback ).find( 'img' ).removeClass( 'active' ).hide(); nextImg.addClass( 'active' ).show(); if ( nextImg.next().length == 0 ) { $( this ).hide(); } }); // binding event prev $( o.prev ).bind( 'click' ,function(){ var prevImg = $( thisCallback ).find( '.active' ).prev(); if ( prevImg.length == 0 ) { return false; } $( o.next ).show(); $( thisCallback ).find( 'img' ).removeClass( 'active' ).hide(); prevImg.addClass( 'active' ).show(); if ( prevImg.prev().length == 0 ) { $( this ).hide(); } }); } })(jQuery); </code></pre>
    singulars
    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.
    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