Reputation: 607
First of all, Look at this picture to understand what I mean by a slider:
Problem :
Let's say I have a scrollable div with height:50%
and the content is some lines so when the window is full screen I will not see a scroller like this:
But if I will resize the browser window the scroller will be like that:
So as you saw the scroller will automatically stay at the top, and here is my problem I want it to stay at the bottom (without JavaScript)?
I don't want to make it with JavaScript because I'm already using it in some other things on the same div like (the user have the ability to scroll app without forcing him to go down when there is an update ....), My project is a chatroom
Upvotes: 0
Views: 607
Reputation: 1447
Contrary to what I've read above, this can easily be achieved without JS/JQ.
Create an anchor at the bottom of the DIV
<div id='thediv'>
Your content here
<a id='bottom'>here at the bottom</a>
</div>
Then link to it/call it/add it to your refresh, body onload etc...
<a href='#bottom'>Clicky</a>
Or on the previous page
<a href='chatroom.html#bottom'>Clicky</a>
..and so on. Basic example:
https://jsfiddle.net/gguajng6/
Upvotes: 1