#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Posts
    2
    Rep Power
    0

    Question CSS changes across IFRAMES


    I am useing Paul Sowden's StyleSwitcher script(http://www.alistapart.com/stories/alternate/). But the problem is my site has an IFRAME in the middle that I load my different content pages into. I can't figure out how to make the style switch filter through to all that pages inside of that frame. If you respond to this please do it in as much detail and simple terms as possible, I am a Rookie after all.
  2. #2
  3. No Profile Picture
    rubbish in javascript
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2001
    Location
    London
    Posts
    703
    Rep Power
    14
    >I can't figure out how to make the style switch filter through to all that >pages inside of that frame

    what do you mean filter through, if you want css to affect the pages you load in the iframe the css has to be contained within the page loaded or linked to it.

    it may be possible to via javascript assign a style to a page in a frame/iframe but i have doubts.

    a+
    gar
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Posts
    2
    Rep Power
    0
    yeah ... that's what i was wondering. The script also uses a cookie ... so maybe there is a way to make the pages that load into that frame pick up the cookie currently being used ... I don't know ... maybe ... eh ... need help. I've had those ideas ... just don't know hwo to do them thanks for the response.
  6. #4
  7. No Profile Picture
    rubbish in javascript
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2001
    Location
    London
    Posts
    703
    Rep Power
    14
    well thing is you've got quite a few different things to piece together to get this to work, the first thing i would ask is; is the page you load in the iframe one of your pages or a page from another site?

    if the page is yours it should be easy enough, and you could do it by say passing a variable in the url to the page, then all the page has to do is load the style sheet according to the variable, this will mean that if you change style the iframe page will reload (ie it won't change instantly like in the url you posted) which is the way i would do it, the page changing instantly could do weird things to the page and/or not render correctly, its more sure by reloading the page fresh.


    if the page is not yours but someone elses then this was where i was unsure cos you need to target the content of the iframe from the main page, here you really need to ask someone whos good in javascript (absolutely not me because its a lot more complex than the demo page which changes itself

    a+
    gar

IMN logo majestic logo threadwatch logo seochat tools logo