473,320 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

object.style has no properties

I'm trying to write a script to make images fade in and out using the
varrious CSS attitrubes that browsers use for that purpose. In an a
tag, surrounded an image, I pass to the fade function the variable
this, and when I try to edit the style on that variable, I get an
error "object.style has no properties". Why wouldn't it? And what
can I do to fix it? Here's the page / code:

http://www.frostjedi.com/terra/dev/test.html
Jul 23 '05 #1
4 3310
yawnmoth wrote:
I'm trying to write a script to make images fade in and out using the
varrious CSS attitrubes that browsers use for that purpose. In an a
tag, surrounded an image, I pass to the fade function the variable
this, and when I try to edit the style on that variable, I get an
error "object.style has no properties". Why wouldn't it? And what
can I do to fix it? Here's the page / code:

http://www.frostjedi.com/terra/dev/test.html


In your timeouts, you don't pass an object but a string by surrounding
nereidFadeObjects with single quotes. Just remove these quotes:

setTimeout("changeOpac(" + i + ",'nereidFadeObjects[" +
object.sourceIndex + "]')",(timer * speed));

should be

setTimeout("changeOpac(" + i + ",nereidFadeObjects[" +
object.sourceIndex + "])",(timer * speed));

Daniel
Jul 23 '05 #2
yawnmoth wrote:
<snip>
... , I get an
error "object.style has no properties". Why wouldn't it?
And what can I do to fix it? Here's the page / code:

http://www.frostjedi.com/terra/dev/test.html


The setTimeout calls to - changeOpac - have string literals as their
second argument, and strings (even when type converted to String
objects) do not have - style - properties:-

setTimeout("changeOpac(" + i + ",'nereidFadeObjects[" +
object.sourceIndex + "]')",(timer * speed));

Removing the single quote characters should rectify that problem:-

setTimeout("changeOpac(" + i + ", nereidFadeObjects[" +
object.sourceIndex + "])",(timer * speed));

Richard.
Jul 23 '05 #3
te*******@yahoo.com (yawnmoth) wrote in message news:<a0**************************@posting.google. com>...
I'm trying to write a script to make images fade in and out using the
varrious CSS attitrubes that browsers use for that purpose. In an a
tag, surrounded an image, I pass to the fade function the variable
this, and when I try to edit the style on that variable, I get an
error "object.style has no properties". Why wouldn't it? And what
can I do to fix it? Here's the page / code:

http://www.frostjedi.com/terra/dev/test.html


thanks Daniel and Richard! :)

now i have another similar problem...

I'm specifying the color of some text using a CSS class, and
javascript seems to be unaware of it. specifying the color via
style="whatever' in the a tag fixes the problem, but i don't to do
that. so how can i access those CSS attributes that aren't defined
via style?

Here's a webpage demonstrating the problem:

http://www.frostjedi.com/terra/dev/test2.html

If you move your cursor over the HTML 4.01 valid link, and then move
it away, you'll get a pop up demonstrating that javascript is unaware
of the CSS-defined color.
Jul 23 '05 #4

yawnmoth wrote:
te*******@yahoo.com (yawnmoth) wrote in message

news:<a0**************************@posting.google. com>...
I'm trying to write a script to make images fade in and out using the varrious CSS attitrubes that browsers use for that purpose. In an a tag, surrounded an image, I pass to the fade function the variable
this, and when I try to edit the style on that variable, I get an
error "object.style has no properties". Why wouldn't it? And what
can I do to fix it? Here's the page / code:

http://www.frostjedi.com/terra/dev/test.html


thanks Daniel and Richard! :)

now i have another similar problem...

I'm specifying the color of some text using a CSS class, and
javascript seems to be unaware of it. specifying the color via
style="whatever' in the a tag fixes the problem, but i don't to do
that. so how can i access those CSS attributes that aren't defined
via style?

Here's a webpage demonstrating the problem:

http://www.frostjedi.com/terra/dev/test2.html

If you move your cursor over the HTML 4.01 valid link, and then move
it away, you'll get a pop up demonstrating that javascript is unaware
of the CSS-defined color.


See here:
http://www.oreillynet.com/pub/a/java...p5/index5.html

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ralph?? | last post by:
I'm trying to use object pointers to access/modify various properties of various layers. The problem i'm having is that pointers created within my functions dont have world scope even though the...
5
by: fred | last post by:
I don't know if I'm doing this correctly. I have a little programming experience in python, c++ and some others but this is my first time with javascript. I'm trying have my website detect the...
1
by: scottf35 | last post by:
Hello, Can someone please point me to THE source for complete javascript documentation? Particualry I am interested in the document object. For example with, document.getElementById(id),...
6
by: Luke | last post by:
Here is my emails to Danny Goodman (but probably he is very busy so he didn't answered it). First email(simple): Subject: JavaScript Arrays " We all know the array can act like HashMap, but is...
38
by: VK | last post by:
Hello, In my object I have getDirectory() method which returns 2-dimentional array (or an imitation of 2-dimentional array using two JavaScript objects with auto-handled length property - please...
15
by: matko | last post by:
Hi! In one of the two examples for the PaintEventArgs.Graphics-property (in the VS 2005 documentation), the Graphics-object is "saved" to a local variable, before being used. In the other...
12
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. ...
2
by: Moses | last post by:
Hi All, Is is possible to catch the error of an undefined element while creating an object for it. Consider we are not having an element with id indicator but we are trying to make the object...
26
by: momobear | last post by:
hi, I am puzzled about how to determine whether an object is initilized in one class, anyone could give me any instructions? here is an example code: class coffee: def boil(self): self.temp =...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.