goldrake73
10-22-2004, 03:20 PM
Hello, I'am building a wysiwyg editor and I have trouble to detect an object like a TABLE, an IMAGE etc...
I found this method but it only works with MSIE...
Is there a way to do the same thing in MOZILLA ???
Here is my code...
if (this.myEditor.document.selection.type == 'Control')
{
var range = this.myEditor.document.selection.createRange();
// Check if one object is selected
if (range.length == 1 && (range(0).tagName == 'TABLE' || range(0).tagName == 'table'))
{
current_width=range(0).width;
current_height=range(0).height;
current_border=range(0).border;
current_bordercolor=range(0).borderColor;
current_cellspacing=range(0).cellSpacing;
current_cellpadding=range(0).cellPadding;
current_align=range(0).align;
current_bgcolor=range(0).bgColor;
alert (current_width);
// alert other variables to view...
return true;
}
}
I found this method but it only works with MSIE...
Is there a way to do the same thing in MOZILLA ???
Here is my code...
if (this.myEditor.document.selection.type == 'Control')
{
var range = this.myEditor.document.selection.createRange();
// Check if one object is selected
if (range.length == 1 && (range(0).tagName == 'TABLE' || range(0).tagName == 'table'))
{
current_width=range(0).width;
current_height=range(0).height;
current_border=range(0).border;
current_bordercolor=range(0).borderColor;
current_cellspacing=range(0).cellSpacing;
current_cellpadding=range(0).cellPadding;
current_align=range(0).align;
current_bgcolor=range(0).bgColor;
alert (current_width);
// alert other variables to view...
return true;
}
}