Forum Moderators: open
This is what I'm using now, it seem to work for everything but Safari, but some people say they don't have trouble with Safari, so I am lost as what I need to add to be sure I get safari generically supported.
/* ... */txt = "<html>\r\n";
txt += "<head>\r\n";
txt += "<style>\r\n";
txt += "body { background-color : #ffffff; font-family : arial, helvetica, sans-serif; margin : 0px; padding : 4px }\r\n";
txt += ".nsw, .swe { font-size : 12px }\r\n";
txt += ".nsw { color : #252525 }\r\n";
txt += ".swe { color : #fa6105; border : 1px solid #91d591; padding-left : 2px; padding-right : 2px; background : #e7f4e7 }\r\n";
txt += "</style>\r\n";
txt += "</head>\r\n";
txt += "<body>\r\n";
txt += "<div class='nsw'>" + scd + "<span id='highlight' class='swe'>" + scb + "</span>" + sce + "<br /></div>\r\n";
txt += "</body>\r\n";
txt += "</html>\r\n";
spell.document.open();
spell.document.write(txt);
spell.document.close();
/* try different methods to scroll to the highlight div */
// this where the problem is!
try
{
spell.document.getElementById('highlight').scrollIntoView();
}
catch(e)
{
try
{
spell.scroll(0, spell.document.getElementById('highlight').offsetTop);
}
catch(e)
{
try
{
spell.scrollTo(0, spell.document.getElementById('highlight').offsetTop);
}
catch(e)
{
alert(e.description);
}
}
}
TIA
sd!