Hi,
when you format a selected text (i.e. bold), then set the focus on something else on the page and then click the formatted bold text, the button for making the text bold becomes a blue background.
The button "knows" that the selection is bold.
How can i find out the formatting of the selected clicked text with custom code?
Let's say i want to intergrate my own "bold-button" somewhere else on the page, wich changes it's background depending on the selection in the ckedtior.
I'm searching for something like this:
Thanks in advance.
Martin
when you format a selected text (i.e. bold), then set the focus on something else on the page and then click the formatted bold text, the button for making the text bold becomes a blue background.
The button "knows" that the selection is bold.
How can i find out the formatting of the selected clicked text with custom code?
Let's say i want to intergrate my own "bold-button" somewhere else on the page, wich changes it's background depending on the selection in the ckedtior.
I'm searching for something like this:
if(CKEDITOR.currentSelection.IsSurroundedByTag("b"))
{
...
}Thanks in advance.
Martin

Re: Get current formatting
CKEDITOR.style
editor.on( 'instanceReady', function() { var style = new CKEDITOR.style( { element : 'b' } ); editor1.attachStyleStateChange( style, function( state ) { if ( state == CKEDITOR.TRISTATE_ON ) alert( 'The current state for the B element is ON' ); else alert( 'The current state for the B element is OFF' ); }); );