Skip to content

non-Ajax equivalent of changeContent() method and more. #10

@stanislaw

Description

@stanislaw

Hello, Thomas.

Please, consider adding following public methods:

  1. Method "currentScroll" (or currentOffset maybe?) which will return current offset. Without having it, I need to rip it now from .data("scrollWrapper").scrollLeft() (I found you do it this way in a source code).

  2. Method which is Non-AJAX equivalent of changeContent but allowing to just insert(after/before) or replace simple html content. This is how I do it now, ripping more low-level stuff from your source:

$(smooth_div).data('scrollableArea').html(content);

var current_scroll = $(smooth_div).data("scrollWrapper").scrollLeft();

$(smooth_div).smoothDivScroll("recalculateScrollableArea"); 

$(smooth_div).smoothDivScroll('move', current_scroll);

I hope this piece clearly demonstrates the need of the second method.

Maybe, 'currentScroll' method even is not needed, if non-Ajax 'changeContent' will encapsulate preserving of current offset after content change.

Also please see my 'sortable_smooth' branch in my fork of your repo: https://github.com/stanislaw/Smooth-Div-Scroll/tree/sortable_smooth.

See there 'sortable_smooth.html'. It is just your demo index.html with three or four lines added. It is a demonstration of how SmoothDivScroll can play very nice with jQuery Sortable so itt becomes Smooth Sortable Div Scroller. ;)
Maybe you will want somehow adapt it to your examples page.

I found the possibility of this mixture (smooth sortables) very useful in my current project.

That is all!

Thanks for a great work on plugin!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions