3

I am working in an existing page and when it is resized the Menu breaks a bit and the only way I found to fix that is once the page is resized I reload the page and the styles are ok.

The problem is when chrome ask me to translate the page...the resize method is fired and the page reloads but I don't want this.

Is there any way to know if the resize was done by chrome in order to avoid this behaviour? or maybe you could tell me another way to fix that.

Thanks

seba47
  • 320
  • 1
  • 11
  • Maybe http://stackoverflow.com/questions/2980520/how-to-specify-your-webpages-language-so-google-chrome-doesnt-offer-to-transla – putvande Jan 16 '14 at 19:25
  • @putvande thanks for your comment, I saw this but I have several pages andalso I don't want to add meta tags to them because maybe some of them could be transalated. I don't know if there would be a way to catch this message box. Thanks anyway – seba47 Jan 16 '14 at 19:30
  • Not sure there is. Good luck. – putvande Jan 16 '14 at 19:32
  • 1
    Why not fix the core of the problem, the styles? Forcing your page to reload if the window gets resized is an awful idea. – Etheryte Feb 07 '14 at 20:54

1 Answers1

0

Chrome (as well as other browser) will raise a resize event every time the viewport size changed.

Unfortunately, you cannot know what triggers this size change: is it the "distraction free" mode (F11) ? opening the web developper tools ? translate toolbar ? a window minification ? or simply a manual window resize ?

Therefore you should not react to resizes by reloading the page. There are many possible ways to fix your menu with some JS. Perhaps can we help you in another dedicated question.

Feugy
  • 1,898
  • 14
  • 18
  • Thanks for reply, I have fixed that showing when the hight of the page change more than 100px I reload the page, if not I won't do nothing because it could be causing by the translate box. Thanks – seba47 Feb 18 '14 at 17:08
  • You're welcome. If it's sufficient, yould you mind closing the question ? Thanks. – Feugy Feb 19 '14 at 06:23
  • could you tell me how to close the question? I have not found it! I will be waiting your response, thanks – seba47 Feb 19 '14 at 13:53