Advanced User Interface Controls and Components
Retrieves the current position of the scrollbar in TreeView.
This method doesn't have any parameters.
An object that represents the current position of horizontal and vertical scrollbar in TreeView.
Supported in: v1.0.
In this example we are showing how to get the current position of scrollbar in TreeView, by using the getScrollPos method.
$(document).ready(function() {
// Create an instance of TreeView widget
var $tree = $('#treeview').treeview();
var getCurrentSelection = function(){
return $tree.treeview("option", "selectedItem");
}
showPos = function(){
var pos = $tree.treeview("getScrollPos");
alert("the current position of scrollbar is: { x: " + pos.x + ", y: " + pos.y + "}");
}
});
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/integralui.treeview.css" />
<link rel="stylesheet" href="css/themes/theme-blue.css" />
<script type="text/javascript" src="external/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="external/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="external/jquery.ui.widget.min.js"></script>
<script type="text/javascript" src="js/jquery.integralui.widget.min.js"></script>
<script type="text/javascript" src="js/jquery.integralui.treeview.min.js"></script>
</head>
<body>
<div id="treeview" class="widget"></div>
</body>
</html>
.widget
{
width: 300px;
height: 300px;
}