Wilq32.Magnitude
 

Go back to main page: http://wilq32.blogspot.com/

Magnitude class written in pure Javascript.

Actual Version: 0.2

Last Relase: 12.04.2008

Author: Wilq32 (Pawel Witkowski) wilq32@gmail.com

Turn ONTurn OFFToggle

Description:
This is a small class that allows you to put big image as a small image with Magnifier. It uses keyboard arrows, or mouse to move around. You can turn on or turn off magnifier for an image. This is a function that you can add to i.e. onclick event on image.

Use:

magnet = new Wilq32.Magnitude(DIVID,smallImage,bigImage,[magnifyWidth,magnifyHeight,magnifyPositionX,magnifyPositionY])

Required parameters:
- DIV, a ID of <DIV> element to put into your image,
- smallImage, URL to your small image,
- bigImage, URL to your big image,

Optional parameters:
- magnifyWidth, width of your zoom, default 100
- magnifyHeight, height of your zoom, default 100
- magnifyPositionX, position of bigImage corresponding to mouse position, default 100
- magnifyPositionY, position of bigImage corresponding to mouse position, default 100
- keySpeed, speed in pixel to move every keypress, default 5

Functions:

magnet.turnOn() - turns on visible constantly (not only via mouseover)
magnet.turnOff() - turns off visible constantly (visible only on mouseover)
magnet.toggle() - swap between on and off

Known Bugs:
- When DIVID is around <CENTER> tag in IE, it makes some unproper behaviour :(

Change Log:

- version 0.2:

- Added disabled functionality,

- version 0.1:

- Main relase,