HighDots Forums  

Displaying CSS Styles on Element Mouse Over

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Displaying CSS Styles on Element Mouse Over in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
splounx
 
Posts: n/a

Default Displaying CSS Styles on Element Mouse Over - 09-25-2007 , 11:22 PM






Hi there,

I am a relative CSS & JavaScript novice and I have a particular
problem that is beyond my level of knowledge so I thought I'd tap the
collective wisdom of this group.

I would like to know if there is a means of writing JavaScript that
will dynamically display the styles which are currently applied to any
DOM element on a web page ( i.e., those applied by ID, those applied
by class, etc.) as the user moves their mouse over them.

Ideally the styles would be displayed in a tooltip style pop-up layer
which would remain displayed until the user mouses off the element.
But how exactly the styles are displayed is not critical. The idea is
that the web page itself would act as a sort of live stylesheet
reference, dynamically revealing to the user which styles are being
applied to which elements, allowing a stylesheet author to know which
styles they need to customize to affect a given element.

I would greatly appreciate any help or suggestions you may have on how
this can be achieved in a way that will work consistently in most
popular modern browsers.

Many thanks in advance.


Reply With Quote
  #2  
Old   
Jeff North
 
Posts: n/a

Default Re: Displaying CSS Styles on Element Mouse Over - 09-26-2007 , 07:31 AM






On Wed, 26 Sep 2007 04:22:05 -0000, in
comp.infosystems.www.authoring.stylesheets splounx <splounx (AT) gmail (DOT) com>
<1190780525.356473.88930 (AT) 50g2000hsm (DOT) googlegroups.com> wrote:

Quote:
| Hi there,
|
| I am a relative CSS & JavaScript novice and I have a particular
| problem that is beyond my level of knowledge so I thought I'd tap the
| collective wisdom of this group.
|
| I would like to know if there is a means of writing JavaScript that
| will dynamically display the styles which are currently applied to any
| DOM element on a web page ( i.e., those applied by ID, those applied
| by class, etc.) as the user moves their mouse over them.
|
| Ideally the styles would be displayed in a tooltip style pop-up layer
| which would remain displayed until the user mouses off the element.
| But how exactly the styles are displayed is not critical. The idea is
| that the web page itself would act as a sort of live stylesheet
| reference, dynamically revealing to the user which styles are being
| applied to which elements, allowing a stylesheet author to know which
| styles they need to customize to affect a given element.
|
| I would greatly appreciate any help or suggestions you may have on how
| this can be achieved in a way that will work consistently in most
| popular modern browsers.
|
| Many thanks in advance.
If you are using Firefox you can download the Web Developer Toolbar.
The Information submenu can do what you want and more.
-- -------------------------------------------------------------
jnorthau (AT) yourpantsyahoo (DOT) com.au : Remove your pants to reply
-- -------------------------------------------------------------


Reply With Quote
  #3  
Old   
David Dorward
 
Posts: n/a

Default Re: Displaying CSS Styles on Element Mouse Over - 09-26-2007 , 08:05 AM



On Sep 26, 5:22 am, splounx <splo... (AT) gmail (DOT) com> wrote:
Quote:
Ideally the styles would be displayed in a tooltip style pop-up layer
which would remain displayed until the user mouses off the element.
But how exactly the styles are displayed is not critical. The idea is
that the web page itself would act as a sort of live stylesheet
reference, dynamically revealing to the user which styles are being
applied to which elements, allowing a stylesheet author to know which
styles they need to customize to affect a given element.
Firebug's DOM inspector perhaps?
http://dorward.me.uk/tmp/ZZ19A0D46F.jpg
http://www.getfirebug.com/

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/



Reply With Quote
  #4  
Old   
julian.bash
 
Posts: n/a

Default Re: Displaying CSS Styles on Element Mouse Over - 09-26-2007 , 10:30 AM



On Sep 26, 3:05 pm, David Dorward <dorw... (AT) gmail (DOT) com> wrote:
Quote:
On Sep 26, 5:22 am, splounx <splo... (AT) gmail (DOT) com> wrote:

Ideally the styles would be displayed in a tooltip style pop-up layer
which would remain displayed until the user mouses off the element.
But how exactly the styles are displayed is not critical. The idea is
that the web page itself would act as a sort of live stylesheet
reference, dynamically revealing to the user which styles are being
applied to which elements, allowing a stylesheet author to know which
styles they need to customize to affect a given element.

Firebug's DOM inspector perhaps?http://dorward.me.uk/tmp/ZZ19A0D46F....etfirebug.com/

--
David Dorwardhttp://dorward.me.uk/http://blog.dorward.me.uk/
If you don't use firefox (for what reason ever), use the xray
bookmarklet: <http://www.westciv.com/xray/>.



Reply With Quote
  #5  
Old   
Ben C
 
Posts: n/a

Default Re: Displaying CSS Styles on Element Mouse Over - 09-27-2007 , 04:11 PM



On 2007-09-26, splounx <splounx (AT) gmail (DOT) com> wrote:
Quote:
Hi there,

I am a relative CSS & JavaScript novice and I have a particular
problem that is beyond my level of knowledge so I thought I'd tap the
collective wisdom of this group.

I would like to know if there is a means of writing JavaScript that
will dynamically display the styles which are currently applied to any
DOM element on a web page ( i.e., those applied by ID, those applied
by class, etc.) as the user moves their mouse over them.

Ideally the styles would be displayed in a tooltip style pop-up layer
which would remain displayed until the user mouses off the element.
But how exactly the styles are displayed is not critical. The idea is
that the web page itself would act as a sort of live stylesheet
reference, dynamically revealing to the user which styles are being
applied to which elements, allowing a stylesheet author to know which
styles they need to customize to affect a given element.

I would greatly appreciate any help or suggestions you may have on how
this can be achieved in a way that will work consistently in most
popular modern browsers.

Many thanks in advance.
You can use the getComputedStyle method to find the styles that apply to
an element, but it won't tell you which selectors in which stylesheets
they came from.

But just use Firebug. http://www.getfirebug.com/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.