Code breaks IE scrollbars

1

123Jim

Tom de Neef said:

I changed them back temporarily to != ,but I found the same error message
in IE for the same place in the code.

I also went back to the older code from here:
http://elouai.com/javascript-drag-and-drop.php which does not break IE
scrollbars on that page but the same code breaks IE scrollbars on my page
.... That page does not specify a doctype .. hmmm..... puzzling
 
S

Scott Sauyet

In my javscript testpage:http://myweb.tiscali.co.uk/ladycroft/webdevfun/problem_solving.html

IE scrollbars don't drag with mouse pointer .. (works in other browsers)
IE tells me: "Object required" on Line 74, Char 3

|71| var fobj = nn6 ? e.target : event.srcElement;
|72| var topelement = nn6 ? "HTML" : "BODY";
|73|
|74| while (fobj.tagName !== topelement && fobj.className !==
"dragme")
|75| {
|76| fobj = nn6 ? fobj.parentNode : fobj.parentElement;
|77| }

On line 72, in IE, you set the top element to "BODY", but the object
you're working on (from the event.srcElement) is the HTML node.
You're never going to traverse up from there to the BODY.

-- Scott
 
1

123Jim

Scott said:
On line 72, in IE, you set the top element to "BODY", but the object
you're working on (from the event.srcElement) is the HTML node.
You're never going to traverse up from there to the BODY.

Many thanks, the code no longer breaks IE .. that gotta be good!
I changed this:
var topelement = nn6 ? "HTML" : "BODY";
to this:
var topelement = "HTML";
 
D

Denis McMahon


Checks type and value.

Examples:

(0 == false) = true
(0 === false) = false // different types
(0 != false) = false
(0 !== false) = true // different types

Probably a moot point for object comparisons though, but very important
if a function returns returns false for failure and can return 0 as a
valid result.

Rgds

Denis McMahon
 
T

Tom de Neef

Denis McMahon said:
Checks type and value.

Examples:

(0 == false) = true
(0 === false) = false // different types
(0 != false) = false
(0 !== false) = true // different types

Probably a moot point for object comparisons though, but very important
if a function returns returns false for failure and can return 0 as a
valid result.

Thank you.
Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top