I have a valid reason for using the following code.. (making sure the content, regardless of user's screen size.. is under 600px;)
Therefore I'm running the following:
The problem is I have to click "Run JS" TWICE to get the updated properies of insC.
First click - scrollWidth = 579
Second click - scrollWidth = 911
My question is how can I get that 911 on the first run through. It's almost like insC properties (ie.. scrollWidth) needs to be repopulated based on the new content that was just applied.. insC.Focus() did not work.
Any ideas??
Therefore I'm running the following:
<form name="form" method="post" action="sdaf"> <cfmodule template="/fckeditor/fckeditor.cfm" basePath="/fckeditor/" instanceName="teaser" value="<table width='900'><tr><td>900 pixels wide</td></tr></table>" width="100%" height="300"> <BR><BR> <cfmodule template="/fckeditor/fckeditor.cfm" basePath="/fckeditor/" instanceName="teaserC" value="abc" width="600" height="300"> <input type="button" onclick="run2();" value="Run JS"> <script> function run2() { var ins = FCKeditorAPI.GetInstance('teaser') ; var insC = FCKeditorAPI.GetInstance('teaserC') ; alert("FCK 1 = " + ins.GetHTML()); insC.SetHTML(ins.GetHTML()); alert('FCK 2 content now the same'); alert(insC.EditorDocument.body.scrollWidth); } </script> </form>
The problem is I have to click "Run JS" TWICE to get the updated properies of insC.
First click - scrollWidth = 579
Second click - scrollWidth = 911
My question is how can I get that 911 on the first run through. It's almost like insC properties (ie.. scrollWidth) needs to be repopulated based on the new content that was just applied.. insC.Focus() did not work.
Any ideas??