You are not logged in.
Pages: 1
I would like to be able to make the browser scroll to an instance of xinha editor. For example if i have a regular <textarea> i can do document.getElementById("textareaID").focus() and this works fine. but for some reason i can not do this with a Xinha textarea. An thoughts on how to accomplish this??
Offline
At first glance (meaning poor knowledge and thinking time) the focus should be setted on the Xinha div created not the textarea
Hope that helps!
Offline
the focus should be set to the iframe created by xinha!
editor.focusEditor()
...where editor is the editor-object.
...although i think that setting the focus doesn't scroll the page(?)
Niko
Offline
editor.focusEditor() doesn't scroll the browser to the xinha instance. I suppose I could use scrollTo() but how do you know the coordinates of the editor?
Offline
Ok, so I can now get the the browser window to scroll to a certain instance by doing this...
make a link <a href="javascript:goTo(edName)"/>
function goTo(edName) {
xinha_editors[edName].activateEditor();
xinha_editors[edName].focusEditor();
xinha_editors[edName].scrollToElement();
}
The problem is this will only work in IE and I would like it to work in FF too. Also, if you click the link once and it takes you to the editor, then scroll back up and click it again it doesn't work, seems like something to do with focus still being on the editor??
Offline
Still can't get this to work in firefox, anyone else have a clue?
Offline
Pages: 1