PDA

View Full Version : [DHTML] Image Warper



mburt
08-21-2006, 03:13 AM
1) CODE TITLE: Image Warper

2) AUTHOR NAME/NOTES: Michael Burt

3) DESCRIPTION: Visually warps the image specified. Instructions on how to use are on the page below.

4) URL TO CODE: http://www40.brinkster.com/mburt/scripts/warp_image.htm

blm126
08-21-2006, 03:27 AM
Couple questions, why are you using eval? and what is the point of the new keyword?

Twey
08-21-2006, 04:26 AM
Answers, could be wrong but it's a guess:
why are you using eval?To prevent the numbers being concatenated as a string. This isn't necessary, remove "eval" and simply use the brackets to make sure the addition is processed before the concatenation.
and what is the point of the new keyword?There is no point, here. mburt, new is only useful if you intend to assign properties to the created object.

Also, flexibility could be improved by using position: relative; rather than position: fixed;.

mburt
08-21-2006, 03:35 PM
Thanks Twey I'll look into those measures.

Oops!!
I forgot to take out the "new". I was going to make the images elements, and assign properties through the new function, but I changed my mind and forgot to take it out :)

mburt
08-21-2006, 03:38 PM
blm126: If you said 1 + i, without brackets or eval, the string would literally be 1 than whatever variable i was.

Ex:

If I is one:
11

If I is two:
12

etc.

It wouldn't actually add the string, which in this case is what I want to do :)

blm126
08-23-2006, 10:38 PM
yes, I know that. but what I didn't get is why you were using eval instead of brackets

mburt
08-25-2006, 07:46 PM
I dunno. I felt like it :p