Author Topic: Javascript zoom control  (Read 8062 times)

marison

  • Jr. Member
  • **
  • Posts: 42
Javascript zoom control
« on: April 06, 2009, 08:17:45 pm »
As I'm developing, I' m sending here some suggestions to the next version. One of them I feel lack of.. "zoom in" function in megazine.js
:) thanks!

DavidC

  • Guest
Re: Javascript zoom control
« Reply #1 on: May 03, 2009, 07:53:47 pm »
I'd like to see zoom control kept as simple as possible, so that it does not detract from the natural function and look of the page flipping. On my site I'm displaying A4 pages of text. I haven't used 'hires' or fullscreen zooming at all as I feel it may add an unnecessary layer of complexity for some users. Instead, I've allowed the A4 text to be displayed at its normal size by changing the height in the stylesheet from 100% to 1169px and the width from 100% to 1652px. The height of the page now becomes greater than the browser window and the browser's vertical scrollbar can be used to move down. When the first page is turned the page width is doubled. (826*2=1652. 826/1169=0.707 and (A4) 210/297=0.707). The horizontal scrollbar is used to move across, but now it has become a little fiddly as both scrollbars need to be moved to pan inside the browser's window. A javascript function to dynamically move the view as the mouse nears the side of the browser window would be useful. I believe two things are required:
1. track the mouse movement within the browser window.
2. when the mouse coordinates are within a distance from the browser's edge of (browser width / 4), then scroll towards that edge -  (using javascript 'scrollBy' I believe).
I'm attaching the megazine3 code I'm using.
« Last Edit: May 05, 2009, 12:09:34 am by DavidC »

marison

  • Jr. Member
  • **
  • Posts: 42
Re: Javascript zoom control
« Reply #2 on: May 06, 2009, 06:31:02 pm »
I go with DavidC on that point.

Another two things I can say about it :

1) The javascript zoomIn function doesn't enter in zoom mode, it only increase the zoom size when the page is already zoomed. So we can't create a button outside the page called "Click here to zoom the page".

2) There could be a javascript function to enter in fullscreen mode. Why do I ask that? I think a lot of people wish changing the megazine gui without change anything in flash(.fla) sources (because they can keep the sources always up-todate) , so these people will do a html integration. If you use the fullscreen mode on Minefield browser, for example, it doesn't work. Finally, if we have this function in javascript we could give an option to user choose by checking a fullscreen checkbox,etc...

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Javascript zoom control
« Reply #3 on: May 06, 2009, 07:07:52 pm »
@marison:
1) added to todo list
2) not technically possible, I'm afraid. This is one of Flash's security limitations: fullscreen can only be triggered by a user action, e.g. mouse clicks or key presses.

@DavidC: I'll give it some thought, but I won't promise anything ;)
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.