Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.musoftware.de!wum.musoftware.de!news.karotte.org!uucp.gnuu.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <5918594.n9F9iRqjVt@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Mon, 12 Nov 2012 19:30:24 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. Newsgroups: comp.lang.javascript References: <50a11e21$0$6849$e4fe514c@news2.news.xs4all.nl> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 51 NNTP-Posting-Date: 12 Nov 2012 19:30:25 CET NNTP-Posting-Host: a015feb7.newsspool1.arcor-online.net X-Trace: DXC=NO_UeMm:hbEX36K@\WTHGJic==]BZ:afN4Fo<]lROoRAnkgeX?EC@@@>32E0LlHXPKDZm8W4\YJNLJ`:FmdeL>K@d@Z]ZC][K6ElKhjhQbPL3F X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:17194 Tom de Neef wrote: > Code below is the core of what I use to let a
be resized by dragging > an icon in the bottom-right corner. > (I deleted the bits relevant for reporting to the server.) > It works (FF, Chrome, IE8) but it is not ideal. In Chrome and IE > underlying text gets 'blacked' sometimes and in FF the mouse-up goes > unnoticed. FF dragging is smooth though. > Check http://84.86.145.75 to see why I am not satisfied. (Fully formated > script via menu File - Inspect source.) > I must be able to do better and I hope that you can give suggestions. You need to prevent the default action for mouse events and selection events on the content of the resizable element while you are resizing it. However, it might be better by now to set the CSS `resize' property on the element that you want to be resizable, and use scripting only as fallback. > //script type="text/javascript" > function stopEventProgression(evt) { > evt.cancelBubble = true; > if (evt.stopPropagation) {evt.stopPropagation()}; > } Not a good idea. You are preventing elements higher in the document tree from receiving the event (thereby potentially crippling the user interface), but you are not preventing the elements themselves from reacting to this event and other events. Besides, if (evt.stopPropagation) is insufficient and error-prone a feature test. Unless it was fixed in MSHTML, this might throw an exception if the method was implemented. Consider if (jsx.object.isHostMethod(evt, "stopPropagation")) or similar code instead. PointedEars -- Sometimes, what you learn is wrong. If those wrong ideas are close to the root of the knowledge tree you build on a particular subject, pruning the bad branches can sometimes cause the whole tree to collapse. -- Mike Duffy in cljs,