Right now while I'm typing this theres the preview down below the editor. I would like to do something similair and am wondering how Stack Overflow does this? Thanks!
does that handle the code snippet markup too then?
Zeus
2009-09-25 14:14:09
Thanks, any idea how to remove the toolbar from the editor?
Shawn
2009-09-25 14:46:20
Off the top of my head no, as I've never used it. But taking a look at the features section of their website, they say to look at optionsExample.html in the zip folder for configuration help.
Brandon
2009-09-25 14:52:47
+1
A:
$(function(){
// whenever the text in the editor box changes:
$("#editorTextArea").change(function(){
// add the text to the preview box below
// this certainly involves some formatting/marking up of the text
// but this is good enough for illustrative purposes
$("#previewBox").val(this.value);
});
});
inkedmn
2009-09-25 14:12:59
Doesn't work like that because the change Event is only fired after the blur event; or: change will only fire if the content has changed AFTER it lost its focus. If you want to update while typing, you pretty much have to go with the keydown Event.
Mike
2009-09-25 14:21:33