0

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.

Vartika
  • 1,085
  • 3
  • 17
  • 43

3 Answers3

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?

Community
  • 1
  • 1
Braj
  • 46,415
  • 5
  • 60
  • 76
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