[thelist] Got it!(was: can't find image position unless set with CSS?)

AtdtXav atdtxav at yahoo.com
Thu Dec 13 14:09:50 CST 2001


Here is what I did, or the parts that are important:

in page - <IMG src="clear.gif" name="invisible">
checkforQTenabled()

then the function -
function checkforQTenabled() {
	var ht = parseInt(document.invisible.offsetTop);
	//	document.writeln(ht);
	if (ht < 200)
	window.location.href =
"http://www.servername.com/beta/Index/not_on.html";
}

Simple, yes?  I used the commented writeln to determine how far
the image was from the top with QT enabled and with quicktime
disabled, and used that to determine a reasonable number (the
image was 102 down with QT disabled, 520 with QT enabled).  

If they've gotten this far, they have quicktime installed for
sure (previous page checks for that), and I can't seem to find
_anywhere_ you can disable your plugins in netscape without
actually uninstalling them.  

So this code only has to apply for Internet Explorer, so long as
it doesn't break in Netscape.

*does a little dance*
Scott

Thanks to those evolters who responded *beams*.  It was a big
help!

--- AtdtXav <atdtxav at yahoo.com> wrote:
> Hmm...  So what you are saying, Mark, is that you cannot get
> the
> position of an image or other element without having
> previously
> set a location for that element with CSS?
> 
> I realize that CSS is what we're supposed to use for
> positioning, but I would find it a major oversight if the only
> reason a person can't identify the position of an image was
> because they allowed it to be placed on the page in the manner
> that HTML dictates (IE below anything previously scripted in
> HTML).
> 
> --- Mark Howells <mark at mountain.ch> wrote:
> > I think you'll find that the only way to get that
> information
> > is by
> > analysing the [element].top attribute in Javascript, which
> > points to the CSS
> > setting (or returns null if there is nothing set).
> > 
> > Regards
> > Mark Howells
> > Working in a Winter Wonderland
> > http://www.mark.ac
> > 
> > 
> > > Von: AtdtXav <atdtxav at yahoo.com>
> > > Antworten an: thelist at lists.evolt.org
> > > Datum: Thu, 13 Dec 2001 10:07:03 -0800 (PST)
> > > An: thelist at lists.evolt.org
> > > Betreff: Re: [thelist] javascript question (easy?) <-- not
> > so easy
> > > 
> > > All I need is the actual, real position of an element, not
> a
> > > position listed in a stylesheet.
> > 
> > 
> > -- 
> > For unsubscribe and other options, including
> > the Tip Harvester and archive of TheList go to:
> > http://lists.evolt.org Workers of the Web, evolt ! 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Check out Yahoo! Shopping and Yahoo! Auctions for all of
> your unique holiday gifts! Buy at http://shopping.yahoo.com
> or bid at http://auctions.yahoo.com
> 
> -- 
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com




More information about the thelist mailing list