3

I am working with a Javascript project and I want to draw a line with arrow and easily rotate in any direction. I prefer HTML4 instead of HTML5.

So can any one tell me the solution?

what i want is in this link .... but not in HTML5 but in HTML4
http://deepliquid.com/projects/blog/arrows2.html

nehit
  • 117
  • 2
  • 7
  • 1
    I would suggest u canvas (https://developer.mozilla.org/en/HTML/Canvas), but since it is HTML5 and works only on 'modern' browsers, you could use a lib like raphaelJS(http://raphaeljs.com/) to achieve that goal..it makes vectorial drawing fully compatible through both svg and vml :) – stecb May 24 '11 at 08:33

2 Answers2

1

If you just care about animation (and maybe keyboard control), canvas is faster. If you want dynamic interaction (e.g., the ability to click on the line, arrow, etc.), then SVG is best. SVGWeb and ExplorerCanvas offer some compatibility with IE for both of these...

Brett Zamir
  • 14,034
  • 6
  • 54
  • 77
0

I asked almost the same and ended up using Raphael (after the first 2 version)

If instead of an arrow, a line is enough, please look at:

How to draw a line between draggable and droppable?

demo:

http://www.balexandre.com/jQuery/draganddrop/testing_DragAndDrop.htm

if you really need to draw an arrow at the end, you can append the arrow object to the code, if you need help on this, let me know.

Community
  • 1
  • 1
balexandre
  • 73,608
  • 45
  • 233
  • 342
  • @balexander:yeah i want an arrow at the end of the line and also it can easily rotate in every direction with that arrow....so please help me out – nehit May 24 '11 at 08:56
  • Did you see the code? you can easily rotate to where you want, just append the path `x` and `y`. I suggest that you read and test some Raphaël examples before everything else or you will ask a lot of questions that are basic. – balexandre May 24 '11 at 11:15