SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Evangelist SpaceFrog's Avatar
    Join Date
    Jan 2005
    Location
    Outerspace
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [solved] Lost my code ...

    I just can't remember how to change a css attribute propriety ...

    I am not thinking of ClassName or style.

    I am talking about the style between style tags in the head... I know it's set something ... setClass ???
    Last edited by SpaceFrog; May 2, 2005 at 23:36.

  2. #2
    SitePoint Guru
    Join Date
    Feb 2005
    Posts
    602
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try innerHTML.

    i.e. getElementById('some_style_element').innerHTML = 'p { display: none; }';
    Last edited by Maian; May 2, 2005 at 02:32.

  3. #3
    SitePoint Addict
    Join Date
    Nov 2003
    Location
    Malmoe, Sweden
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can it be the styleSheet object and the rules collection you are looking for?

  4. #4
    SitePoint Evangelist SpaceFrog's Avatar
    Join Date
    Jan 2005
    Location
    Outerspace
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for replying guys,
    Lets try and make it clearer :


    I have got a style sheet:

    PHP Code:
    <style type=text/css'>
    div {background-color:silver;}
    </style> 
    I want to modify or add proprieties in the style sheet ...
    I could as proposed redefine the whole of innerHTML but I just want to modify or add one element.
    I have already come accross a possibility that wouls look like:

    PHP Code:
    document.StyleSheet.div.setPropriety('Background-color''blue'
    But I juste can't find it again ...

  5. #5
    SitePoint Addict
    Join Date
    Nov 2003
    Location
    Malmoe, Sweden
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  6. #6
    SitePoint Evangelist SpaceFrog's Avatar
    Join Date
    Jan 2005
    Location
    Outerspace
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow !

    As far as I can remember this is not the method I was looking for but it's far better ...

    Thanks a bunch andrin !!!

  7. #7
    SitePoint Addict
    Join Date
    Nov 2003
    Location
    Malmoe, Sweden
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    np :-) glad I could help.

  8. #8
    SitePoint Guru
    Join Date
    Feb 2005
    Posts
    602
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #9
    SitePoint Addict
    Join Date
    Nov 2003
    Location
    Malmoe, Sweden
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even better. Good old faithful PPK :-)

  10. #10
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by andrin
    Can it be the styleSheet object and the rules collection you are looking for?
    You can lead a horse to water, but you can't make him drink.

  11. #11
    SitePoint Evangelist SpaceFrog's Avatar
    Join Date
    Jan 2005
    Location
    Outerspace
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the horse


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •