Comments (2)
I figured out the part how to trigger a refresh in order to scroll to the bottom of my container div.
HTML:
<div id="mycontainer" slimscroll="slimscrollOpts"><!-- put my elements here --></div>
Controller:
$scope.slimscrollOpts = { /* my usual initialization opts for slimscroll */ }
// other code goes here
$scope.mycontent.push(newelem);
$scope.slimscrollOpts.scrollTo = myEndPosition;
At least this makes my container to always jump to the bottom with a proper myEndPosition being set, as there is a watcher on the slimscrollOpts.
However, the rail bar on the right is not updated, and if I hover it, it shows my initial position. Any idea how to update/redraw that part properly?
from angular-slimscroll.
@agranig
Thanks for your post, and I checked the source code of slimscroll, when you pass the scrollTo in the options, slimscroll jump to the content, and ignore the scroll bar, from line 120 to 140:
if ('scrollTo' in options)
{
// jump to a static point
offset = parseInt(o.scrollTo);
}
else if ('scrollBy' in options)
{
// jump by value pixels
offset += parseInt(o.scrollBy);
}
else if ('destroy' in options)
{
// remove slimscroll elements
bar.remove();
rail.remove();
me.unwrap();
return;
}
// scroll content by the given offset
scrollContent(offset, false, true);
I think set true to the the second parameter and false to the third parameter of scrollContent, then your problem will be solved, but you need your own copy of slimscroll or raise a merge request to slimscroll.
from angular-slimscroll.
Related Issues (20)
- Update slimscroll dependency to 1.3.3 HOT 1
- Add bower installation instructions HOT 2
- Disable angular-slimscroll HOT 1
- Use slimscroll in combination with ui router HOT 8
- Does not work HOT 4
- Double slimscrolls HOT 8
- double scrollbar added HOT 6
- Refresh/Update doesn't seem to be fully working. HOT 2
- Publishing to NPM HOT 1
- Options do not work HOT 4
- When window resize, Height auto Issue HOT 1
- How can i bind event
- Add slimscroll-watch attribute to documentation HOT 1
- customization is not working HOT 1
- Inner scroll not working HOT 2
- npm package not correct
- start: 'bottom' option does not work. HOT 3
- Hide scrollbar when it isn't need
- allowPageScroll is not working??? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-slimscroll.