|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
WYSIWYG in an inline DIV
OK, I've been playing with all sorts of MSHTML since reading your article and I was wondering what the best way is to show an entire document in edit-mode (unframed, no scroll like the Ilayer has by default). I've tried this in an inline div, and it seems pretty nice, but a few things need tweaking for their DOM references to work again. The advantage I found also is that I can use the onPaste event and filter (via functions) pasted text to get out some of that Word garbage code before allowing the paste to occur. I can't seem to get the event to work at all on the ILAYER.
Any help on either getting this to work or the ILAYER to stretch to the length of the document like the DIV does? Any other cool ideas to share with regards to the WYSIWYG editor? |
|
#2
|
|||
|
|||
|
hmm, when using a iframe theirs some JS code that you sometimes have to use, but i cant remember it lol, its something like
document.body.iFame_name something like that, is that what your trying??? hope it helps |
|
#3
|
|||
|
|||
|
hey,
i mainly work with MSHTML and iFrames, because i find them easier, but doesnt an ilayer have style.width, so you could use: iLayer.style.width = '100%'; assuming that it's in a container that is as wide as the area you want it to fill... |
|
#4
|
|||
|
|||
|
Yeah, I've got the width right, but I want the LENGTH to be 100% of the document. This is how it works with a DIV with overflow: none; It lets you preview the content a lot easier, but of course does not work as well for really long docs. I am making my editor a CF custom tag, so I planned to omplement both an inline (div) and embedded (ilayer) field as an attribute in calling the custom tag.
If I could somehow get the ILAYER to expand with my document and also recognize an onPaste event, there would be no need for the DIV version, as it causes a few other problems itself. |
|
#5
|
|||
|
|||
|
Aha! I've scrapped the inline DIV now that I wrote a function to expand my IFRAME to the length of the document. I simply init the function in the main WYSIWYG init(). Then I added a window-title bar atop the editor with expand and restore functions that calls a resize function. In expanded mode, I set a setInterval that sets the Iframe height equal to the content scrollHeight like so:
document.all.#ATTRIBUTES.EDITPANE#.style.height=#A TTRIBUTES.EDITPANE#.document.body.scrollHeight+50; Obviously if you're not using Cold Fusion, you need to sub out the variable in #'s with a proper object reference. In case you're still wondering, the whole point of this exercise was to allow for the entire content to be viewable without a limited size IFRAME that requires scrolling. The toggle made it easier to handle with long content tho, as well. Now if only I could get the onPaste event to fire in an IFRAME... |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > WYSIWYG in an inline DIV |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|