rdlebreton wrote:[color=blue]
> I've been trying to develop my own version of these draggable
> layers and I have been limiting myself to IE6...for now.[/color]
IE is probably one of the worst browsers to do primary development on.
It is so error tolerant, and supports so many non-standard methods that
what works on IE often will not work on browsers that are actually
equally dynamic and capable (at least in the area of DHTML). Working
with IE may tend to give the script author the impression that it is a
lot of work to create cross-browser scripts, while developing on a
browser that implements W3C DOM standard methods, but is intolerant of
errors, will usually result in code that also works on IE, along with
all other browsers that implement those methods.
[color=blue]
> I have
> looked at some other examples to get ideas of creating an alternative
> to pop-up windows in a web page. The code I have works (sort of).
> The problem is that I can move these layers around when I move the
> mouse slowly, however, if I move it fast the web browser looses track
> of the motion and leaves the layer behind.[/color]
Yep has already pointed out why that happens. It is rarely possible to
animate a DIV sufficiently quickly or accurately to genuinely follow
mouse movements over that DIV. Instead following mouse movements at the
document level is more practical, but mouse movements events at that
level are to quick to allow any animation to directly follow from those
events, so the actual animation has to be done by a method that uses
setTimeout or setInterval.
[color=blue]
> If anyone has some ideas
> or suggestions it would be much appreciated.[/color]
Well, suggestions must include more considered z-index handling. And
positioning DIVs that contain form controls suffers from the problem
that some controls cannot be covered by a DIV on some browsers, which
suggests that DIVs such controls might some measure to hide those
controls when their DIV is covered with another, so some sort of
detection of overlapping DIVs.
<snip>[color=blue]
> <script language="JavaScript" src="DivLayer.js"></script>[/color]
Valid Html 4 requires opening script tags to include a type attribute,
which, once provided, renders the deprecated language attribute
redundant.
[color=blue]
> <script language="JavaScript" src="DateTime.js"></script>[/color]
The Date script does not appear to have any baring on the problem.
<snip>[color=blue]
> <td id="titleBar" style="cursor:move"[/color]
<snip>[color=blue]
> <div id="titleBar"[/color]
<snip>[color=blue]
> <div id="titleBar"[/color]
<snip>
ID attributes are supposed to be unique within a document.
Recently I have been investigating using DIVs as an alternative for
tasks that are often attempted with new windows (because of the
irresolvable pop-up blocking problem) so I thought I would have a look
at your script, and have a go at re-implementing it to do what you
wanted. The results are to big to post so I have made them available
on-line at:-
<URL:
http://www.litotes.demon.co.uk/examp...iWindow_1.html[color=blue]
>[/color]
(Note: don't expect this file to be available for more than a week or
two.)
- it could still stand some more work, and more general testing (I have
only tired it with windows versions of Opera, Mozilla and IE so far) but
might be worth a look.
Richard.