Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>No idea what you want to do with your animation stuff, you'll need to explain that better or update with a JSFiddle that shows your problem.</p> <p>I created a simple JSfiddle for you where you can see how to scroll inside a jpane to the position of the clicked element. You'll find what you need in the documentation here: <a href="http://jscrollpane.kelvinluck.com/scroll_to_animate.html" rel="nofollow">http://jscrollpane.kelvinluck.com/scroll_to_animate.html</a></p> <p>Fiddle: <a href="http://jsfiddle.net/Djby5/5/" rel="nofollow">http://jsfiddle.net/Djby5/5/</a></p> <pre><code>//wrap in local scope $(function() { var pane = $('.scroll-pane'); pane.jScrollPane( { showArrows: true, animateScroll: true } ); var api = pane.data('jsp'); $('.grid li').click(function () { $(this).removeClass('.grid') var offset = $(this).offset(); //scroll to the position api.scrollToY(offset.top); }); }); </code></pre> <p>I suggest you start simple like this, and then add your additional animations that you want ontop of this. Ovveride the animate() function in jpane and replace it with your advanced animation, or just use <a href="http://api.jquery.com/animate/" rel="nofollow">jquery's animate()</a> and call <code>api.reinitialise();</code> if you alter or hide DOM elements in your animation and want the jpane scrollable area to be updated.</p> <p><strong>EDIT</strong> Paste from the source code of jpane:</p> <pre><code>// This method is called when jScrollPane is trying to animate to a new position. You can override // it if you want to provide advanced animation functionality. It is passed the following arguments: // * ele - the element whose position is being animated // * prop - the property that is being animated // * value - the value it's being animated to // * stepCallback - a function that you must execute each time you update the value of the property // You can use the default implementation (below) as a starting point for your own implementation. animate: function(ele, prop, value, stepCallback) { var params = {}; params[prop] = value; ele.animate( params, { 'duration' : settings.animateDuration, 'easing' : settings.animateEase, 'queue' : false, 'step' : stepCallback } ); } </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. 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