Connecting Tech Pros Worldwide Help | Site Map

How do I make an Image visible?

Cov
Guest
 
Posts: n/a
#1: Sep 30 '07
Hi,

I have the following code:
<script>
LeftCurtain=new Image(midPoint,ht);
LeftCurtain.src="images/black.gif";
LeftCurtain.left="0px";
LeftCurtain.top="0px";
LeftCurtain.visibility="visible";
</script>


Nothing appears. Not in Firefox, Opera or IE7.

Can anyone let me know what's wrong?

Richard Cornford
Guest
 
Posts: n/a
#2: Sep 30 '07

re: How do I make an Image visible?


David Mark wrote:
Quote:
On Sep 30, 3:31 pm, Cov wrote:
<snip>
Quote:
Quote:
> LeftCurtain=new Image(midPoint,ht);
>
Where are these two parameters defined?
>
Quote:
> LeftCurtain.src="images/black.gif";
> LeftCurtain.left="0px";
>
LeftCurtain.style.left = "0";
Zero is zero, regardless of the unit. Also, you need to set the
position property to absolute, fixed or relative (default is static.)
>
Quote:
> LeftCurtain.top="0px";
>
Same problem here.
<snip>

Not that it is a problem as such. Not providing a non-zero dimension
with a unit can be a problem but omitting the unit from a zero dimension
is not required.

A more significant issue may follow from the assumption that the object
returned from - new Image( ... ) - would have a - style - object. There
is no specification that could provide guidance, but historically that
has not necessarily been the case.

Richard.

Cov
Guest
 
Posts: n/a
#3: Sep 30 '07

re: How do I make an Image visible?


On Sep 30, 11:10 pm, David Mark <dmark.cins...@gmail.comwrote:
Quote:
Again, sounds like a pretty poor (or at least outdated) guide.
http://www.amazon.com/JavaScript-Def...1186893&sr=8-1

David Mark
Guest
 
Posts: n/a
#4: Sep 30 '07

re: How do I make an Image visible?


On Sep 30, 5:12 pm, "Richard Cornford" <Rich...@litotes.demon.co.uk>
wrote:
Quote:
David Mark wrote:
Quote:
On Sep 30, 3:31 pm, Cov wrote:
<snip>
Quote:
Quote:
LeftCurtain=new Image(midPoint,ht);
>
Quote:
Where are these two parameters defined?
>
Quote:
Quote:
LeftCurtain.src="images/black.gif";
LeftCurtain.left="0px";
>
Quote:
LeftCurtain.style.left = "0";
Zero is zero, regardless of the unit. Also, you need to set the
position property to absolute, fixed or relative (default is static.)
>
Quote:
Quote:
LeftCurtain.top="0px";
>
Quote:
Same problem here.
>
<snip>
>
Not that it is a problem as such. Not providing a non-zero dimension
with a unit can be a problem but omitting
You lost me there unless you are talking about older browsers where
typeof(el.style.top) == 'number'.

the unit from a zero dimension
Quote:
is not required.
Not required, it just seems silly to me to provide one. One caveat is
that Firefox returns "0pt" (of all things) for the computed style when
the unit is left off the assignment. It doesn't really matter as you
obviously ignore the unit in any case where the value is zero.
Quote:
>
A more significant issue may follow from the assumption that the object
returned from - new Image( ... ) - would have a - style - object. There
Right. That's why I told the OP to use createElement.

Randy Webb
Guest
 
Posts: n/a
#5: Oct 1 '07

re: How do I make an Image visible?


Thomas 'PointedEars' Lahn said the following on 9/30/2007 6:16 PM:
Quote:
Cov wrote:
Quote:
>On Sep 30, 11:10 pm, David Mark <dmark.cins...@gmail.comwrote:
Quote:
>>Again, sounds like a pretty poor (or at least outdated) guide.
>http://www.amazon.com/JavaScript-Def...1186893&sr=8-1
>
Thanks for further confirmation that also this book can definitely and
safely be recommended against. How many more bad examples from it are
required until the FAQ maintainer eventually removes the recommendation from
the FAQ?
It won't be removed any time in the foreseeable future so you can -
safely - stop asking for it to be removed.

And, what does the third edition have to do with the edition listed in
the FAQ?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Cov
Guest
 
Posts: n/a
#6: Oct 1 '07

re: How do I make an Image visible?


On Oct 1, 5:07 am, Randy Webb <HikksNotAtH...@aol.comwrote:
Quote:
Thomas 'PointedEars' Lahn said the following on 9/30/2007 6:16 PM:
>
Quote:
Cov wrote:
Quote:
On Sep 30, 11:10 pm, David Mark <dmark.cins...@gmail.comwrote:
>Again, sounds like a pretty poor (or at least outdated) guide.
>http://www.amazon.com/JavaScript-Def...-Flanagan/dp/0...
>
Quote:
Thanks for further confirmation that also this book can definitely and
safely be recommended against. How many more bad examples from it are
required until the FAQ maintainer eventually removes the recommendation from
the FAQ?
>
It won't be removed any time in the foreseeable future so you can -
safely - stop asking for it to be removed.
>
And, what does the third edition have to do with the edition listed in
the FAQ?
>
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
Funny; I ask for help on why a piece of code I write won't work and
get castigated for attempting something that, in the opinion of one
poster, is beyond me.

Then the whole thing degenerates into mud slinging and petty point
scoring.

Does ANYBODY come here for assistance or is this newsgroup solely for
the self-indulgence of the senior members?

Randy Webb
Guest
 
Posts: n/a
#7: Oct 1 '07

re: How do I make an Image visible?


Thomas 'PointedEars' Lahn said the following on 10/1/2007 4:03 AM:
Quote:
Randy Webb wrote:
Quote:
>Thomas 'PointedEars' Lahn said the following on 9/30/2007 6:16 PM:
Quote:
>>Cov wrote:
>>>On Sep 30, 11:10 pm, David Mark <dmark.cins...@gmail.comwrote:
>>>>Again, sounds like a pretty poor (or at least outdated) guide.
>>>http://www.amazon.com/JavaScript-Def...1186893&sr=8-1
>>Thanks for further confirmation that also this book can definitely and
>>safely be recommended against. How many more bad examples from it are
>>required until the FAQ maintainer eventually removes the recommendation from
>>the FAQ?
>It won't be removed any time in the foreseeable future so you can -
>safely - stop asking for it to be removed.
>
You as a *responsible* FAQ editor leaving a statement in the FAQ that this
book is "currently endorsed by c.l.j. regulars of comp.lang.javascript"
should first make sure that it *is* actually currently endorsed by the
regulars of comp.lang.javascript.
It is nice to see that you have assumed I haven't done something that I
did do. Can you post articles in the last 8 months where people have
commented on the book? I have read them all. Perhaps you should also.
Quote:
Or you have proven to be inept enough to be the editor of the newsgroup's
FAQ and should be replaced by a more reasonable person ASAP.
Coming from you, that is hilarious.
Quote:
BTW: It should be "c.l.js" or "cljs" to distinguish it from comp.lang.java.*
The newsgroup is comp.lang.javascript and its abbreviation has always
been clj/c.l.j and I will continue to refer to it as clj/c.l.j as my
mood sees fit.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Gregor Kofler
Guest
 
Posts: n/a
#8: Oct 1 '07

re: How do I make an Image visible?


Cov meinte:
Quote:
I read that and did ask for specifics and was advised to Google for
"JavaScript createElement appendChild." which produced no meaningful
results.
What do you understand by "meaningful results"? I suppose most of the
stuff I know about JS, HTML, PHP, MySQL etcpp. stems from online
resources - mainly queried with a search engine.

"javascript appendchild" gives me the German

http://de.selfhtml.org/javascript/objekte/node.htm

as first hit, which explains the above issue pretty well.

The first English hit is

http://www.howtocreate.co.uk/tutoria...ript/dombasics

which also sports a simple example how appendChild works.

Gregor



--
http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
http://www.licht-blick.at ::: Forum für Multivisionsvorträge
http://www.image2d.com ::: Bildagentur für den alpinen Raum
Dr J R Stockton
Guest
 
Posts: n/a
#9: Oct 3 '07

re: How do I make an Image visible?


In comp.lang.javascript message <4702A484.1060802@PointedEars.de>, Tue,
2 Oct 2007 22:05:24, Thomas 'PointedEars' Lahn <PointedEars@web.de>
posted:
Quote:
>
>You would not leave statements that are made in the name of *all* the
>regulars of the newsgroup in the FAQ if there is any doubt that not all
>regulars of the group support that statement. You would do a strawpoll
>at least once to back up such statements in the FAQ.
In English, in which language you are not as adept as you seem to think,
"the regulars" does not necessarily imply "all of the regulars"; indeed,
we should use "all of the regulars" if we want to mean that. It only
means a substantial majority of the regulars; maybe over 66%, better
over 75% or 80%; 90% seems too high a mark.

--
(c) John Stockton, Surrey, UK. ???@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Laurent vilday
Guest
 
Posts: n/a
#10: Oct 3 '07

re: How do I make an Image visible?


Thomas 'PointedEars' Lahn a écrit :
Quote:
BTW: It should be "c.l.js" or "cljs" to distinguish it from comp.lang.java.*
LOL

<news://comp.lang.java.security>
<news://comp.lang.java.setup>
<news://comp.lang.java.softwaretools>

--
laurent
rf
Guest
 
Posts: n/a
#11: Oct 12 '07

re: How do I make an Image visible?


Whover wrote:

Would you take this bloody shit offline please!



Dr J R Stockton
Guest
 
Posts: n/a
#12: Oct 12 '07

re: How do I make an Image visible?


In comp.lang.javascript message <zJidnZFoo-BIX5PaRVn_vwA@giganews.com>,
Thu, 11 Oct 2007 20:42:01, Randy Webb <HikksNotAtHome@aol.composted:
Quote:
>
>Again, you refuse to accept what I agreed to do. What you keep whining
>about is that I won't do more than I agreed to do. And in regards to
>that, what I said I would do is *very* relevant.
The question is also one of whether we understood and agreed to that;
and of whether what you are now doing is satisfactory.

In comparison with what all other active FAQ maintainers do, your
approach is ludicrous.

--
(c) John Stockton, Surrey, UK. ???@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Randy Webb
Guest
 
Posts: n/a
#13: Oct 13 '07

re: How do I make an Image visible?


Dr J R Stockton said the following on 10/12/2007 3:42 PM:
Quote:
In comp.lang.javascript message <zJidnZFoo-BIX5PaRVn_vwA@giganews.com>,
Thu, 11 Oct 2007 20:42:01, Randy Webb <HikksNotAtHome@aol.composted:
Quote:
>Again, you refuse to accept what I agreed to do. What you keep whining
>about is that I won't do more than I agreed to do. And in regards to
>that, what I said I would do is *very* relevant.
>
The question is also one of whether we understood and agreed to that;
and of whether what you are now doing is satisfactory.
It was stated enough in the thread I pointed you to that if you did not
understand what I offered to do then it was because you took no effort
to understand it.
Quote:
In comparison with what all other active FAQ maintainers do, your
approach is ludicrous.
What is "ludicrous" is your inability to accept that I offered to do
something and I have done exactly what I said I would do.

Stop whining and let it go. Sheesh.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dr J R Stockton
Guest
 
Posts: n/a
#14: Oct 13 '07

re: How do I make an Image visible?


In comp.lang.javascript message <jqSdnZjjjaQp1Y3aRVn_vwA@giganews.com>,
Sat, 13 Oct 2007 00:26:04, Randy Webb <HikksNotAtHome@aol.composted:
Quote:
>Dr J R Stockton said the following on 10/12/2007 3:42 PM:
Quote:
>In comp.lang.javascript message <zJidnZFoo-BIX5PaRVn_vwA@giganews.com>,
>Thu, 11 Oct 2007 20:42:01, Randy Webb <HikksNotAtHome@aol.composted:
Quote:
>>Again, you refuse to accept what I agreed to do. What you keep whining
>>about is that I won't do more than I agreed to do. And in regards to
>>that, what I said I would do is *very* relevant.
> The question is also one of whether we understood and agreed to
>>that;
>and of whether what you are now doing is satisfactory.
>
>It was stated enough in the thread I pointed you to that if you did not
>understand what I offered to do then it was because you took no effort
>to understand it.
That is irrelevant.
Quote:
Quote:
>In comparison with what all other active FAQ maintainers do, your
>approach is ludicrous.
>
>What is "ludicrous" is your inability to accept that I offered to do
>something and I have done exactly what I said I would do.
Which is not what needs to be done.

There is a mistake in the parenthesised text of FAQ 4.16 (ignoring the
missing comma).

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Delphi 3? Turnpike 6.05
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htmclpdmFAQ;
<URL:http://www.borland.com/newsgroups/guide.htmlnews:borland.* Guidelines
Randy Webb
Guest
 
Posts: n/a
#15: Oct 14 '07

re: How do I make an Image visible?


Dr J R Stockton said the following on 10/13/2007 6:21 PM:
Quote:
In comp.lang.javascript message <jqSdnZjjjaQp1Y3aRVn_vwA@giganews.com>,
Sat, 13 Oct 2007 00:26:04, Randy Webb <HikksNotAtHome@aol.composted:
Quote:
>Dr J R Stockton said the following on 10/12/2007 3:42 PM:
Quote:
>>In comp.lang.javascript message <zJidnZFoo-BIX5PaRVn_vwA@giganews.com>,
>>Thu, 11 Oct 2007 20:42:01, Randy Webb <HikksNotAtHome@aol.composted:
>>>Again, you refuse to accept what I agreed to do. What you keep whining
>>>about is that I won't do more than I agreed to do. And in regards to
>>>that, what I said I would do is *very* relevant.
>> The question is also one of whether we understood and agreed to
>>that;
>>and of whether what you are now doing is satisfactory.
>It was stated enough in the thread I pointed you to that if you did not
>understand what I offered to do then it was because you took no effort
>to understand it.
>
That is irrelevant.
No, it is the problem. You want to continue to whine about something
after the fact that you had ample opportunity to comment on before it
happened. You had no written objections at the time and now, after
almost a year, you want to whine and complain about it.
Quote:
Quote:
Quote:
>>In comparison with what all other active FAQ maintainers do, your
>>approach is ludicrous.
>What is "ludicrous" is your inability to accept that I offered to do
>something and I have done exactly what I said I would do.
>
Which is not what needs to be done.
Either way, you have two choices:

1) Accept it.
2) Continue to whine like an 8 year old.
Quote:
There is a mistake in the parenthesised text of FAQ 4.16 (ignoring the
missing comma).
Then read the FAQ, find out how to make a request to have it corrected,
and it will get corrected. Pay real close attention Section 5.2 and the
last line of the first paragraph of the preceding sub-section.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#16: Nov 7 '07

re: How do I make an Image visible?


Laurent vilday wrote:
Quote:
Thomas 'PointedEars' Lahn a écrit :
Quote:
>BTW: It should be "c.l.js" or "cljs" to distinguish it from comp.lang.java.*
>
LOL
>
<news://comp.lang.java.security>
<news://comp.lang.java.setup>
<news://comp.lang.java.softwaretools>
`cljs' is ambiguous, indeed; however, `c.l.js' is not.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Randy Webb
Guest
 
Posts: n/a
#17: Nov 7 '07

re: How do I make an Image visible?


Thomas 'PointedEars' Lahn said the following on 11/7/2007 10:16 AM:
Quote:
Laurent vilday wrote:
Quote:
>Thomas 'PointedEars' Lahn a écrit :
Quote:
>>BTW: It should be "c.l.js" or "cljs" to distinguish it from comp.lang.java.*
>LOL
>>
><news://comp.lang.java.security>
><news://comp.lang.java.setup>
><news://comp.lang.java.softwaretools>
>
`cljs' is ambiguous, indeed; however, `c.l.js' is not.
I am thoroughly impressed. It only took you 35 days to respond. WOW.

Either way, I am still going to refer to it as c.l.j, deal with it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Closed Thread