How to create a box with a cursur?

Discussion in 'JavaScript' started by jameslat, Mar 15, 2010.

  1. #1
    How can i use a cursur to create a box on my website?
    such as it starts at a certain x,y and for every px i pull in either x,y (or both) the box will increase in size. and then whenever i let go it will save the size as a varible?
    thanks!
    -James
     
    jameslat, Mar 15, 2010 IP
  2. inegoita

    inegoita Member

    Messages:
    54
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    48
    #2
    Hi

    the code below requires jQuery. Dont know if you are familiar with it (you can download it for free just google jQuery).
    The following code will let you draw boxes in your page and will store the width/height of the last drawn box in the lastBoxSize variable

    let me know if you have any questions

     
    inegoita, Mar 16, 2010 IP