...

View Full Version : Right-Clicking Graphics



CarlaN1
07-08-2004, 04:43 AM
I'm new to all of this so thanks ahead to anyone that can help :)
I need to know if it's possible to manipulate an image on a web page so that whenever you right click the image you have the ability to rotate the image.....like mirror it. I'm willing to learn if someone just points me in the right direction, but a given code would be nice to...Thanks again!!

CARLA

coothead
07-08-2004, 05:52 AM
Hi there CarlaN1,

and a warm welcome to these forums :D

What is wrong with left clicking like this....

<img src="http://hstrial-dbayly.homestead.com/files/dog.jpg"
onclick="this.src='http://hstrial-dbayly.homestead.com/files/dogflip.jpg'"
ondblclick="this.src='http://hstrial-dbayly.homestead.com/files/dog.jpg'"
alt="dogs" title="click and double-click"/>
....or mouseover like this...

<img src="http://hstrial-dbayly.homestead.com/files/dog.jpg"
onmouseover="this.src='http://hstrial-dbayly.homestead.com/files/dogflip.jpg'"
onmouseout="this.src='http://hstrial-dbayly.homestead.com/files/dog.jpg'"
alt="dogs" title="mouseover and mouseout"/>

coothead

jbot
07-08-2004, 11:43 AM
I need to know if it's possible to manipulate an image on a web page so that whenever you right click the image you have the ability to rotate the image.....like mirror it.

JS has no in-built graphics processing capabilities such as can be found in Java, Perl or PHP.

but, i suspect, you can use JS to call functions which invoke special filters which can transform images on the fly without recoursing to loading other images. if that's possible, then it's probably M$ only functionality. you could probably find out how to do it by visiting here: http://msdn.microsoft.com/dhtml.

then again, the method coothead has posited is perhaps the best way, since it'll work in any browser. it also means you get more control over the quality of the graphics themselves.

one thing i would suggest tho, is not to take away the browser's right click functionality by intercepting the event and superimosing your own functionality on it. as a user, i'd find that annoying and would probably end up authoring a bookmarklet to eschew it and restore the usual contextmenu.

hope that all makes sense to you :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum