|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
WYSIWYG Editor and CSS
Hi, I'm using the WYSIWYG, but I would like to add the CSS possibility to it, so I have to questions :
- I read about the createStyleSheet possibility to apply a CSS to the iframe, so I did : Code:
<SCRIPT>
iView.document.createStyleSheet('css.css');
</SCRIPT>
Why doesn't It work, whereas if I put the CSS in the <head> section of the edited text it does ? Note that I can't do that way because the edited text is not a full page so i have to get rid of the <body> etc... tags. Note also that I can't use the Init() function Onload because the editor is included in the middle of a page so the onload event doesn't happen. - My second question is : has anybody already done a css parser in PHP that would extract the css class names from the file ? The goal is obviously to to a drop-down menu that would change the selected area class name. So this leads to another question which is : Say I select a whole part of a text, how do I apply the class name specification to all the tags selected through a selectrange() ? Thanks already for your reading ![]()
__________________
who needs to know who i am ?
|
|
#2
|
|||
|
|||
|
The init() firing onload doesn't care where the WYSIWYG is. It renders out the IFRAME and basics and then sets it to editable (and adds the stylesheet, etc) when the page is fully downloaded to the client-side. So if you're having trouble with the init function, it's probably the same reason why the createStyleSheet isn't working.
|
|
#3
|
|||
|
|||
|
no no i don't need the Init() function, it works great since it's only used (in the article) the set the designMode to 'on' which I do later on with a line in a javascript .. so il don't need the Init function, just to have the createStyleSheet function work :/
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > WYSIWYG Editor and CSS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|