Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help with Javascript for style a external Iframe

    Hello,

    i need to add style="background:transparent" in the body of an external frame:

    <iframe name="frm" src="external link">
    #document
    {<html>
    <head>...</head>
    <body class="modelo3" style="background: transparent;">

    .....

    </body>
    }

    </iframe>

    I tried with javascript, but no way.

    Thanks in advance.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,301
    Thanks
    23
    Thanked 612 Times in 611 Posts
    In the iframe definition add allowtransparency="true"
    See if that helps.

  • #3
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the idea, but it doesn't work.

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,301
    Thanks
    23
    Thanked 612 Times in 611 Posts
    Maybe you should post the code your using and not a snip it.

  • #5
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <div class="custom"  >
    	<iframe frameborder="0" height="395" scrolling="no" src="EXTERNAL LINK" width="648">
    </iframe>
    </CODE>
    
    The code of the external frame is:
    
    <CODE>
    #DOCUMENT
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
     <html lang="es">
     <head>
      <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
      
     <!-- CSS -->
     <link rel=.../>
     <link rel=.../>
      <link rel=.../>
     </head>
    
     <body class='modelo2'>
    
    ...
    ...
    more code of body that cames from the external frame...
    ...
    
    </iframe></div>

    AND I NEED TO PUT IN SOMEWAY <body class='modelo2' style="background:transparent">

  • #6
    New Coder
    Join Date
    Nov 2012
    Location
    India
    Posts
    53
    Thanks
    0
    Thanked 3 Times in 3 Posts
    May be you needs to write transparency css on class called "modelo3" I am not sure but may be you can do using CSS3

  • #7
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,700
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    The body has no intrinsic background color, so there’s no point in setting it to “transparent”. I suppose you want the iframe to have a transparent background color?
    It would help if you showed us a live example and mentioned the browser in which the issue occurs.

  • #8
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    css class "modelo3" has a background defined... and i need to overwrite it using "style='background...'

    this is my iframe: http://booking.iberiatrip.com/public...321/2240371588


  •  

    Posting Permissions

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