Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #17194

Re: Resize a <div>

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> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
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+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: Resize a <div>
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

Followups directed to: comp.lang.javascript

Show key headers only | View raw


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


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