[問題] iframe focus問題

看板Ajax作者 (~(⊙o⊙)~)時間15年前 (2010/10/18 10:32), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
想請問一下 如果我希望可以當按下一個圖片時,他就會插入到iframe裡面 然後希望接下來滑鼠游標是自動在iframe那張圖片後, 不用從新再用滑鼠點一次iframe做focus動作 以方便使用者繼續按下他要插入的圖片 不過目前不太曉得要從哪邊加入focus動作 麻煩幫我看一下哪邊有問題 謝謝 <html> <head> <script language="javascript"> function wysiwyg_editor_init(){ document.getElementById("wysiwyg_editor").contentDocument.designMode="on"; document.getElementById("wysiwyg_editor").focus(); } setTimeout("wysiwyg_editor_init()", 1000); function fun(str) { var selection = window.frames["wysiwyg_editor"].getSelection(); var imgElement = document.createElement("img"); imgElement.src=str; selection.getRangeAt(0).surroundContents(imgElement); } </script> </head> <body> <form name="editor_form"> <iframe height="200" width="500" name="wysiwyg_editor" id="wysiwyg_editor" "> </iframe> <br> <div style="width:350px;"> <img src="../images/getTTF1.gif" width="40" height="40" class="img1" onClick="fun(this.src);" style="cursor:pointer;"/> </div> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.109.16.211 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.109.16.211 ※ 編輯: lccf 來自: 140.109.16.211 (10/18 10:32) ※ 編輯: lccf 來自: 140.109.16.211 (10/18 10:35) ※ lccf:轉錄至看板 PHP 10/18 10:35

10/18 16:40, , 1F
哪個編輯器?? 有些編輯器有特殊的寫入法
10/18 16:40, 1F
文章代碼(AID): #1Ckx6ekq (Ajax)
文章代碼(AID): #1Ckx6ekq (Ajax)