Javascript Function using DOM Range

I need a Javascript function to be written. Given a div with some html content and a double-click event from a user, the function needs to return the following:

* the word that was double-clicked upon

* the start offset of the word from the beginning of the div (meaning the number of characters of text between the beginning of the div and the beginning of the word).

* the top, left, and height of the selected word, in pixels.

Note that these requirements are trickier than they might sound at first. For example, if the div contains the html "create a <i>super</i>conductor for the experiment" and the user double-clicks on the word "superconductor", then the word will span across multiple nodes. The function must work equally well on Mozilla and IE6/7. Note that in Mozilla, there is no easy way to obtain the offsetTop and offsetLeft of a Range. If you resort to inserting an element to determine these, your code must also remove the element, leaving all document nodes to form the same exact graph they initially had.

You must fulfill the requirements exactly. If there is some edge case that your code does not cover, then it is not really a solution. I would suggest that you not accept the task unless you are *really* familiar with the DOM implementations in FF and IE. The code must also be well-designed, meaning (for example) it can't be sloppy and method bodies must be under 100 lines.

Skills: Javascript

See more: top graph, number function, graph using c, graph top, graph nodes, graph edge, function number, first graph, example of a requirements document, edge graph, rangeoffsetleft javascript, function range javascript, javascript divcontains function, remove node domrange, dom range, javascript range function, dom range find, dom word clicked upon, range startoffset ie6, using dom range, content meaning, span, resort, mozilla, Implementations

About the Employer:
( 1 review ) Chicago, United States

Project ID: #199105

4 freelancers are bidding on average $205 for this job


PLS see the PMB...

$170 USD in 10 days
(2 Reviews)

plz chekc pmb

$300 USD in 4 days
(0 Reviews)

Dear poster, I can help you. Please see my private message. Thanks.

$150 USD in 3 days
(0 Reviews)

Dear sir,we are interested in your project and we have just gone through your requirements carefully, we certainly can help to fullfill your [url removed, login to view] are a high-tech conpany with abundant experience and excellent progr More

$200 USD in 8 days
(0 Reviews)