Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Move a div with mouse Date: Sat, 25 Jul 2015 14:07:28 +0200 Organization: PointedEars Software (PES) Lines: 48 Message-ID: <13075758.S88mDJZToQ@PointedEars.de> References: <24793803.Cl0v73UULg@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1437826251 1452 eJwFwYEBwCAIA7CXhrSVnSMI/59gQpepNkSBw7EKDyzB/i7eu/JzZuepyIYZjApi1uyu0XkUjBEu (25 Jul 2015 12:10:51 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sat, 25 Jul 2015 12:10:51 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwFwQkBgAAIA8BKQ2BAHOXpH8E7Vwo7jE7z89PNCgB98uXxqkOl7YhQf8tkY42DRLZ/1JBHq7BTo6jZHzk8FLk= Cancel-Lock: sha1:fveM4UTBWIaBFccXmQv2gscaWGM= X-NNTP-Posting-Host: eJwFwQcBwEAIBDBL8HAMOYziX0ITiLGNq8EUhxPK/Sz61Dc7UkI6LpZ71htFMC6iejT9FvoDIHkRLA== Mail-Copies-To: usenet@PointedEars.de Xref: csiph.com comp.lang.javascript:28466 danca (Daniele Campagna) wrote: > Il 07/24/2015 08:36 PM, Thomas 'PointedEars' Lahn ha scritto: >> danca (Daniele Campagna) wrote: > > […] > I TRIED to copy-and-paste and then to adjust the [horrible] result. I think you know what to do now. > So it is not correct to infer[It exists? I mean make a deduction] that > if document.addEventListener does not exist .addEventListener > couldn't instead exist? Yes. > Hummmmm... > (Ubi major minus cessat). _maior_ >>> […] >>> }else{ alert("no event")// just in case} >> >> This may be a syntax error. Your code is so unreadable that it is >> difficult to tell without copying and reformatting it. >> >>> document.onmouseup = function() { >>> document.onmousemove = null; >>> document.onmouseup = null; >>> } >> >> Nonsense. > > Ehm... it should cancel the event listeners - and it seems to work in IE > and FF. What's wrong with canceling eventListeners that simple way? *Events* are canceled, not event listeners. You are defining and _undefining_ event listeners here. It makes no sense to define/*overwrite* an event listener for an event, that may not have been defined in the first place, just to undefine it when the event is fired. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.