Closed Thread Icon

Topic awaiting preservation: 'obj.style.height' - only gets style declared 'inline'? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8944" title="Pages that link to Topic awaiting preservation: &amp;#039;obj.style.height&amp;#039;  - only gets style declared &amp;#039;inline&amp;#039;? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: &#039;obj.style.height&#039;  - only gets style declared &#039;inline&#039;? <span class="small">(Page 1 of 1)</span>\

 
smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 11-16-2003 20:37

Please can you help,

Why does the 'obj.style.height' js method for obtaining style details only work for styles that are applied to an element 'inline' and not for styles applied through seperate <style></style> tags or external stylesheets?

What is the easiest way round this except for applying all styles inline?

Thanks guys,

Jon

visit my CryoKinesis Online Gallery

biu
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Dec 2003

posted posted 12-15-2003 12:45

obj.currentStyle.witdh... works only on IE5+

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 12-15-2003 13:03

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 12-15-2003 15:31

ok, well the 'height' was just an example,

Basically I am trying to obtain all the style attributes for a particular element - the styles are contained in a seperate css file - Now I have been using the 'styleSheets[0].rules...' method to get styles from the style sheet, but that doesn't help me much since those styles are actually attached to a specific object in a way that javascript can grab, I would have to parse the stylesheet and try to match elements to objects. Plus that then wouldn't take into account any styles applied inline or with js after the page load - it's all so complicated.

My reason behind this is that I have been develpoing a script that enables the :hover pseudo class on any type of element in IE (the other browsers already support this feature). So far it is going pretty well but I have reached a few tough points and this is one of them.

If anybody is seriously interested in helping to improve and streamline the code then let me know and I'll post it here, or email it to people (there is quite a lot of stuff at the moment).

Thanks guys,

Jon

<A HREF="http://www.cryokinesis.co.uk" TARGET=_blank>visit

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 12-15-2003 15:49

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Scott
Bipolar (III) Inmate

From: schillmania.com
Insane since: Jul 2002

posted posted 12-15-2003 16:54

currentStyle would likely be the best way to determine the current "rendered" style of an object, though that's IE-only.. There is a "getComputedStyle" DOM version of this, and I could've sworn I had posted something on this a while ago on this forum.. I just couldn't find the thread!

This may suit your need however. http://www.quirksmode.org/dom/getstyles.html
(Refer to the "getStyle" function)

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 12-15-2003 21:05

Hi thanks guys,

Scott - cheers, that was good, I only need IE anyway since moz and opera and any decent browser wont need the script I'm working on as :hover on non anchors works in them.

Ini - I don't have a problem with people 'stealing' my code, at the moment it really isn't worth stealing anyhow, but I'm very much into freedom of JS, I don't believe anything created with JS should be sold or bought. My reason for not posting was it will probably hard to understand and I'm not too good at commenting or explaining to people, therefore if someone does seriously want to work on this and make it a decent bit of code then I'll make the effort to explain it to them, but if people are just casual observers I don't want to be explaining it over and over again. If that makes sense. But I have tried to comment it a little and hopefully it will make sense to some people.

The main issues are these:

1: it doesn't like css shorthand selectors

2: it currently requires non anchor elements which have :hover pseudo class attached to have an ID

3: it doesn't support selectors where the :hover pseudo class isn't attached to the end of it (i.e. '#bob div .area:hover' is ok, but '#bob div:hover .area' wont work)

4: its a scruffy inefficient mess


If you still feel you want to have a look and help out then I have uploaded the files and here is the link:

http://www.cryokinesis.co.uk/os-demo/index.htm

download zipped files

Remember to use IE, although it works ok in moz (moz supports the css effect I'm trying to emulate) the js will throw errors because it is written for IE but has no sniff yet.

Thanks again guys.

[EDIT] - my objective is to get one (if not all) of the many examples of pure css pop-ups/drop-downs to work in IE. I know that it sounds a little dumb to use JS to make a pure CSS effect work, when the same effect could be achieved on all browsers just using JS. But the point is to create neat and correct code that is future compliant, and one day the script will be defunct (if MS pull their finger out) but the site will continue to work. The script has other uses too, but I mostly wanted to do it because it can be done and hasn't.

<A HREF="http://www.cryokinesis.co.uk" TARGET=_blank>visit

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 12-16-2003 10:41

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 12-16-2003 16:01

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 12-17-2003 16:29

Thanks Ini,

The access denied thing is very weird - I have never had that. There is no iframes or out of reach code, everything should be included in the zip (if you were using XP then, for fear of sounded patronising, you did extract all the files before trying to run them didn't you?).

In regards to all the 'browser specific' code - remember that all current browsers seem to support the :hover pseudo-class on elements besides just the 'a' tag. This code is primarily only aimed at rectifying this 'oversight' in PC IE (mac IE supports it too I think).

Also be aware that the file entitled 'gebs.js' is a 'ready made' script courtesy of Simon Willison (getElementsBySelector) - this script is massive, and could possible be trimmed to only supply IE functionality.

And yes the code probably is "excessively intricated", that is my fault, I tend to write code in chunks and stick it together when each bit works, but sometimes I find I have overlooked a problem or bug and I need to write more chunks to 'wedge' in to make it work - hense things soon seem to get a bit raggedy round the edges.

I'm glad I have caught your attention with this one Ini, your assistance is greatly appreciated, with you to stamp some bugs and do some spring cleaning this code much actually be not too bad.

Thanks bud,

Jon

<A HREF="http://www.cryokinesis.co.uk" TARGET=_blank>visit

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 12-18-2003 12:19

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 12-21-2003 20:54

Hope you are all enjoying the christmas season so far,

Anyway, have you had any progress Ini?

I would join you on ICQ but I don't have a number or client since I generally seem to only know people on MSN Messenger.

Does nobody work over weekends? I always seem to notice a lull in forum activity during this period.

Best wishes to all,

Jon

<A HREF="http://www.cryokinesis.co.uk" TARGET=_blank>visit

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 12-22-2003 11:19

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 12-22-2003 17:13

No probs man - I'm busy too, no rush tho, I'm not working on this for any urgent project, it's just one of those niggly things that is always floating around waiting to be finished.

Have a great holiday, take it easy, and eat too much - This can wait to the new year.

Laters InI and the rest of you,

Jon

<A HREF="http://www.cryokinesis.co.uk" TARGET=_blank>visit

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 01-23-2004 01:37

Check this out:
http://www.xs4all.nl/~peterned/csshover.html

It appears that my desired result has now been achieved elsewhere, but his file doesn't deal with selectors and has numerous failings that prevent it from being a 'fix' as such.

Now his approach using a htc file or whatever is pretty good I guess, not that different to just using an external javascript tho.

Still this is something that interests me so if InI or anyone is still interested, lets maybe get some discussion started on how to 'improve' the htc file or rip the jscript from it and make it fit with what I have already created in javascript.

It's a thankless task, but I'd loveya

Cheers guys,

Jon

<A HREF="http://www.cryokinesis.co.uk" TARGET=_blank>visit

« BackwardsOnwards »

Show Forum Drop Down Menu