Reputation: 33
In a web page I need to get the max x and y coordinates.
How this is achieved using JavaScript or with GWT specific code?
Upvotes: 3
Views: 4298
Reputation: 3727
To get the size of the browser window, use:
Window.getClientHeight()
Window.getClientWidth()
To get the size of the html page, use:
Document.get().getScrollHeight()
Document.get().getScrollWidth()
Upvotes: 0
Reputation: 121998
GWT :
import com.google.gwt.user.client.Window;
int height =Window.getClientHeight();
int width =Window.getClientWidth();
Upvotes: 4
Reputation: 82241
you can use scrollHeight
and scrollWidth
for getting whole page dimension.
var pageheight=document.body.scrollHeight ;
var pageweight=document.body.scrollWidth;
Upvotes: 0
Reputation: 70142
Look at the Window
class, it has methods for getting the client height /width:
Upvotes: 5