I want that when my project of gwt loads on any browser its size on browser by default reduces to 90%. I searched for it in javascript but couldnt find anything.
Asked
Active
Viewed 1,801 times
0
-
This may be an option http://www.css3.com/css-zoom/ – marekful May 08 '14 at 10:52
-
Is there any script which changes the size to 90% on the browser and every things set accordingly as we do manually by using ctrl+(-) – Vartika May 08 '14 at 11:10
3 Answers
1
You can try this:
public void onModuleLoad() {
int totalWidth = Window.getClientWidth();
GQuery.$(RootPanel.get()).width((int) (totalWidth * 0.9));
}
For downloading GQuery, go to:
https://code.google.com/p/gwtquery/wiki/Downloads
and download the latest version (right now is gwtquery-1.4.2). Then, in your Xxx.gwt.xml introduce:
<inherits name='com.google.gwt.query.Query'/>
And... happy coding!

apanizo
- 628
- 5
- 11
-
i haven't used gQuery in gwt.is there something i want to import some package ? – Vartika May 08 '14 at 11:19
-
any other way. like i have a project initially it got a form with some text boxes, the form i made using jsni. i tried using css its and also used this $doc.body.style.zoom="70%"; in jsni its working fine but for onlu that particular form . is there any way that whole project zoom level reduced to 90% – Vartika May 08 '14 at 11:30
1
Try with simple CSS
<style type="text/css">
.zoom {
zoom: 0.9; /* all browsers */
-moz-transform: scale(0.9); /* Firefox */
}
</style>
hosted JSP/HTML
<body class="zoom">
For more info have a look at What Does 'zoom' do in CSS?
0
add css on body of your html page of gwt project directly and it will work perfectly for all page of your project.

Vartika
- 1,085
- 3
- 17
- 43