Resize a div layer with javascript
Pseudo formula:
// Acronyms used to save space.
New style.left = PCW+((E.X-PCX)-(MDX-PCX))
New style.top = PCH+((E.Y-PCY)-(MDY-PCY))// PCW/PCH = Previous Container Width/Height.
// E.X/E.Y = Event X/Y.
// PCX/PCY = Previous Container Left/Top.
// MDX/MDY = Mouse Down X/Y (where you clicked).
With this formula you will resize the layer relative to where you clicked on it. An extended version of the movement formula. In effect it will take the existing width/height and add the amount of pixel movement as a positive or negative number.
My example, just view the source to see my code.
Leave a Reply
Welcome to Thronic.com
Search this Site
Miscellaneous Links
Recent Articles
- Google-like search suggestion tool
- Linux Bash Color
- Resize a div layer with javascript
- Moving a div layer with javascript
- Web Galaxy » A sci-fi browser game
- Windows 7 on Asus Eee 900 PC
- IE and PHP sessions
- Wordpress 2.8.6 Spell Check Languages
- Reset MySQL Root Password
- Linux hosts file
- IdleGuard
- Column count in SQL
- String encryption in PHP
- Alphanumeric Captcha values in PHP
- Your own numeric Captcha in PHP
