Using javascript without jQuery, I’d like to enable a user to draw a rectangle that will tag photos. The rectangle is selected by dragging the mouse across the photo. As the user drags out the region the rectangle stretches and shrinks. The user can drag in any direction, including up and to the left, much like the draggable rectangle on most computers’ desktops. What are the style attributes of a div object I should set?
Edit: I’m just looking for the right attribute to set to drag the div edge.
I figured it out. I need to use
offsetLeft,offsetRight,offsetTop,offsetBottom,offsetWidth, andoffsetHeightto get the measurements, and
style.left,style.right,style.top,style.bottom,style.widthandstyle.heightto set them.