SEO forum : Search Engine Optimization Forum

SEO forum : Search Engine Optimization Forum (http://www.seo-guy.com/forum/index.php)
-   Javascript forum (http://www.seo-guy.com/forum/forumdisplay.php?f=36)
-   -   Javascript within an editable iframe (http://www.seo-guy.com/forum/showthread.php?t=14228)

banaax 09-20-2006 10:35 AM

Javascript within an editable iframe
 
I'm trying to make an advanced text editor on the web, I think my best option is an iframe (a text area like this forum uses isn't sufficient since you can't decorate text within the textarea). I'm working with something very simililar to the editor on http://devedge-temp.mozilla.org/vie...1/index_en.html.

My problem (also a problem on site above), when you type something in IE and click outside of what you typed (like the middle of the iframe), the cursor goes to the end of the text, exactly what I want, this doesn't happen in mozilla, you have to click next to the text to get the cursor to move to the end of the text. One solution I was thinking about is adding an onclick event to the area of the iframe that moves the cursor to the end of the text, but since the iframe is not an html element (something like that) you can't add javascript functions, and since the iframe is in designMode any javascript I add in the iframe source doesn't work that (does when designMode is off). Any help is apprechiated.

banaax 09-20-2006 08:40 PM

Okay I figured out my click problem, the solution was to add a textarea inside the iframe with height and width of 100%, I still need to use javascript within the iframe though. One thing I want to to do is syncronize the iframe scroll with a div outside of the iframe.

banaax 09-22-2006 02:58 PM

nevermind solved that problem too

Paz 09-22-2006 10:05 PM

LOL... sorry banaax, I gave up on all but the most basic javascript a long time ago!

Glad you sorted it out!

BSolveIT 09-24-2006 02:40 PM

banaax - sorry, I have to ask as it seems like you want to reinvent the wheel. Are you just trying to create some kind of inline editor? If so, why don't you just use one of the many that are around that you could download? Some are better than others, to be sure, so I guess it depends on your needs. Ultimately, what are you trying to achieve?


All times are GMT -8. The time now is 04:34 PM.

Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.