I tried to clone an input fields position (adding a border to
highlight it with 4 divs) but IE 7 throws an error telling me, "style
is null or not an object". I found a workaround with using the
cumulativeOffset object.

Here the code:
function highlightElem(element) {
    element = $(element);
    var cumulativeOffset = element.cumulativeOffset();

    var top = $('highlightTop');
    //top.clonePosition(element, {setWidth: false, setHeight: false,
offsetLeft: -2, offsetTop: -2}); //doesn't work
    top.setStyle( { top: ( cumulativeOffset.top - 2 ) + 'px', left:
( cumulativeOffset.left - 2 ) + 'px', width: ( element.getWidth() +
4 ) + 'px', height: '1px' } );// works
    top.show();

    [...] // similar for the other 3 borders
}

Any ideas what I am doing wrong here?

ps.
Using the following doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to