1

I want to be able to draw lines on a webpage from one div to another. I've looked around, but all I've seen are hacks that rotate webkit images like this one. Raphel.js is another possiblity, but I'd prefer to avoid importing an entire library if I can. I also need to make sure it works in all browsers.

Is this possible, or am I off my rocker?

UPDATE: I tried Raphael, no dice. Creating the object overwrites what I currently have. Code (In case I did something wrong):

window.onload = function() {
        var paper = new Raphael(document.getElementById('image'), 1024, 768);/*
        var line = paper.path("M 250 250 l 0 -50 l -50 0 l 0 -50 l -50 0 l 0 50 l -50 0 l 0 50 z");
    };
9
  • Do they need to be straight lines are can they be vertical and horizontal connected by right angles Commented May 18, 2012 at 17:29
  • Check out this implementation with jQuery at this post: stackoverflow.com/questions/1104295/… Commented May 18, 2012 at 17:30
  • That uses Canvas, which doesn't work in IE. Commented May 18, 2012 at 17:33
  • IE == :-(, OK let's see, there is a demo that works here: jsbin.com/evoloy/2/edit#preview. it doesn't use canvas Commented May 18, 2012 at 17:35
  • 3
    No framework AND working on all browsers is a pretty tall order. Commented May 18, 2012 at 17:49

1 Answer 1

2

While I could not find a way to do this without a framework, I did find a cross-browser solution in jsPlumb. (Thanks to jeffery_the_wind)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.