I've got the problem with scrollIntoView()
function.
I've got a tree and two buttons:
- first of them will scroll tree to bottom node
- second will scroll tree to top node
I don't know what I should to do that this scroll operation will always scroll node to top of tree. I mean about situation from this fiddle:
http://jsfiddle.net/presto41/xzb62pw5/8/
If you will click on button #button1 (Scroll to bottom node)
then tree will be scroll to the bottom node - but bottom node will not be on the top of tree. It's working as "just show node. Done".
I want that scroll to bottom node will be work as scroll to top node in this scenario:
- click on
#button1 (Scroll to bottom node)
- click on
#button2 (Scroll to top node)
- topNode is on the top of tree
Any ideas? I was trying to manipulate this scrollIntoView()
function by options but either I was doing something wrong or it can't works as I expect.
Edit: I don't understand why anyone give me minus for that question. I made a research, I was trying to solve that problem by myself and I put clear description of my problem. It's irritating.
Edit 2: I haven't ids of these nodes. I've got just node as Fancytree.FancytreeNode object so I need a solution without operation on the node id.
Edit 3: this is my pseudocode witch is the most similar with original: http://jsfiddle.net/presto41/xzb62pw5/27/