Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Right-Clicking Graphics

    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

  • #2
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,695
    Thanks
    0
    Thanked 232 Times in 227 Posts
    Hi there CarlaN1,

    and a warm welcome to these forums

    What is wrong with left clicking like this....
    Code:
    <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...
    Code:
    <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

  • #3
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow

    Quote Originally Posted by CarlaN1
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •