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.

Taidot: Javascript

Näytä lisää: 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

Tietoa työnantajasta:
( 1 arvostelu ) Chicago, United States

Projektin tunnus: #199105

4 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön


PLS see the PMB...

$170 USD 10 päivässä
(2 arvostelua)

plz chekc pmb

$300 USD 4 päivässä
(0 arvostelua)

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

$150 USD 3 päivässä
(0 arvostelua)

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 Lisää

$200 USD 8 päivässä
(0 arvostelua)