Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #17194
| Message-ID | <5918594.n9F9iRqjVt@PointedEars.de> (permalink) |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Organization | PointedEars Software (PES) |
| Date | 2012-11-12 19:30 +0100 |
| Subject | Re: Resize a <div> |
| Newsgroups | comp.lang.javascript |
| References | <50a11e21$0$6849$e4fe514c@news2.news.xs4all.nl> |
| Followup-To | comp.lang.javascript |
Followups directed to: comp.lang.javascript
Tom de Neef wrote:
> Code below is the core of what I use to let a <div> 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.
<http://www.impressivewebs.com/css3-resize/>
> //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, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Resize a <div> "Tom de Neef" <tdeneef@qolor.nl> - 2012-11-12 17:04 +0100
Re: Resize a <div> Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-11-12 19:30 +0100
Re: Resize a <div> "Tom de Neef" <tdeneef@qolor.nl> - 2012-11-13 22:38 +0100
Re: Resize a <div> "Tom de Neef" <tdeneef@qolor.nl> - 2012-11-15 14:30 +0100
Re: Resize a <div> Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-11-15 14:51 +0100
csiph-web