Visualizzazione dei risultati da 1 a 9 su 9

Discussione: problemi con iframe

  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2004
    Messaggi
    24

    problemi con iframe

    ciao, qualcuno sa dirmi come faccio a cambiare il percorso di un'immagine che sta in un iframe della mia pagina?

    cosi non va: document.nomeframe.nomeimmagine.scr=".."

    ho anche un'altro problema: sempre l'iframe nn rispetta la proprietà di allungamento che gli ho dato:
    si allunga solo fino ad un certo punto nonostante gli abbia messo heigth=100% !!

    ho messo l'iframe dentro un div container-page,potrebbe essere questo il problema?

    html, body {
    height: 97%; /* Required */
    }

    body {
    text-align: center;

    }

    #container-page {
    margin: 0 auto;
    width: 800px;
    text-align: left;
    position: relative;
    min-height: 100%; /* For Modern Browsers */
    height: auto !important; /* For Modern Browsers */
    height: 100%; /* For IE */
    }

  2. #2
    Utente di HTML.it
    Registrato dal
    Jan 2004
    Messaggi
    24
    nessuna idea?

  3. #3
    Utente di HTML.it L'avatar di nuky
    Registrato dal
    Oct 2001
    Messaggi
    1,053
    Il percorso dell'immagine lo puoi cambiare così:
    codice:
    window.idIframe.document.getElementById('idImmagine').src='immagine_nuova.jpg';
    Per il problema del dimensionamento dovresti postare il codice completo della pagina.
    - "E' un messaggio. E' di Svarion, della terra di Merdor!"
    - "Busto Arsizio?"
    - "Terrazzo, sgabello, formaggio. Borraccia blu, ca**o di gomma e... CANNUCCIA!"
    - "Ca**o dici? C'è scritto «frocio chi legge»!"

  4. #4
    Utente di HTML.it
    Registrato dal
    Jan 2004
    Messaggi
    24
    grazie per l'aiuto, funziona!

    per semplicità ho messo i codici delle pagine semplificati cosi da poterli salvare in 3 file e provare il tutto

    dov'è che sbaglio? non voglio lo scroll, ma voglio che il frame mi si allunghi! come faceva prima il div che c'ea al posto del frame (perchè prima usavo un div al posto del frame)


    <<index.htm>>

    <html>
    <head>
    <link rel="StyleSheet" type="text/css" href="style.css">
    </head>
    <body >
    <div id="container-page">

    <div id="container-head">
    <div id="head">
    </div>
    </div>

    <div id="container-content">

    <div id="container-sx" >
    <div id="container-rassegne">
    </div>
    <div id="container-abreve">
    </div>
    </div>

    <div id="container-center">
    <div id="container-navigation">
    </div>
    <div id="pagina">
    <iframe frameborder="0" id="iframe" name="iframe" src="framehome.htm"></iframe>
    </div>
    </div>

    <div id="container-dx">
    <div id="menu-destra">
    </div>
    <div id="container-news">
    </div>
    <div id="container-newsletter">
    </div>
    </div>

    </div>

    <div style="height:1.7em;">
    </div>

    <div id="container-foot" align="center">
    <div id="foot">
    </div>
    </div>

    </div>
    </body>
    </html>


    <<framehome.htm>>

    <html>
    <head>
    <link rel="stylesheet" href="frame.css" type="text/css">
    <![if !IE]>
    <link rel="StyleSheet" type="text/css" href="stylenonIE.css">
    <![endif]>
    <!--[if IE]>
    <link rel="stylesheet" href="styleIE.css" type="text/css">
    <![endif]-->
    </head>
    <body>
    [img]index_file/granaio.jpg[/img]
    <div class="frame">



    <h2 class="testo">Lorem Ipsum</h2>
    <p class="testo"> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it?
    It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
    Where does it come from?
    Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

    The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. Where can I get some?
    There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</p>

    </div>
    </body>
    </html>

    <<style.css.htm>>

    * {
    margin: 0;
    padding: 0;
    }

    html, body {
    height: 97%; /* Required */
    }

    body {
    background-image: url(index_file/sfondo.jpg);
    background-repeat: repeat-x;
    background-color: #FF6251;
    text-align: center;
    }

    #container-content {

    }

    #container-content:after {
    clear: both;
    display: block;
    font: 1px/0px serif;
    content: ".";
    height: 0;
    visibility: hidden;
    }

    #container-page {
    margin: 0 auto;
    width: 800px;
    text-align: left;
    position: relative;
    min-height: 100%; /* For Modern Browsers */
    height: auto !important; /* For Modern Browsers */
    height: 100%; /* For IE */
    }


    #container-dx {
    padding-top: 35px;
    display: inline;
    float: left;
    width: 130px;

    }

    #iframe{
    background-image: url(index_file/inverse.gif);
    background-repeat: repeat-x;
    background-color: #ffd2cd;
    height: 50em; /* For IE */
    width:100%;

    }

    #container-sx {
    padding-top: 30px;
    display: inline;
    float: left;
    width: 130px;
    }

    #container-center {
    display: inline;
    float: left;
    width: 535px;
    }

    #pagina{
    border: white solid;
    border-width: 1px 3px 5px 3px;
    }

    #container-navigation{
    background-image:url(index_file/button.gif);
    width: 100%;
    height: 22px;
    }

    #head {
    padding: 1em 0 0 0;
    }

    #container-foot {
    width: 100%;
    position: absolute;
    height: 40px;
    right:0;
    }

    #foot {
    font-weight:bold;
    padding: 0 1em 0 0;
    color: #FFFFFF;
    line-height: 40px;
    }

    #container-news{
    margin-bottom: 10px;
    height:300px;
    width: 130px;
    }

    #container-newsletter{
    margin-bottom: 10px;
    height: 80px;
    width: 130px;
    }

    #container-abreve{
    height: 300px;
    width: 130px;
    }

    #container-rassegne{
    width: 130px;
    }

    #newsletter{
    padding: 5px;
    border: 2px solid #EB9c9c;
    background-color:#ffd2cd;
    }

    #news{
    padding: 0 2px 0 2px;
    border: 2px solid #EB9c9c;
    background-color:#ffd2cd;
    }

    #abreve{
    text-align:right;
    border: 2px solid #EB9c9c;
    padding: 0 2px 0 2px;
    background-color:#ffd2cd;
    }

    #rassegne{
    border: 2px solid #EB9c9c;
    background-color:#EB9c9c;
    }

    #home-img{
    float:right;
    }

    #menu-destra{
    margin-bottom: 35px;
    }

    .rassegna{
    background-image:url(index_file/sfondomenu.JPG);
    height: 35px;
    line-height:35px;
    font-weight:bold;
    }

    .button{
    display: inline;
    float:left;
    }

    .button{
    padding-left: 40px;
    }

    #dropmenudiv{
    position:absolute;
    border:1px solid black;
    border-bottom-width: 0;
    font:normal 12px Verdana;
    line-height:18px;
    z-index:100;
    background-image: url(index_file/sfondomenu.JPG);
    }

    #dropmenudiv a{
    width: 100%;
    display: block;
    text-indent: 3px;
    border-bottom: 1px solid black;
    padding: 1px 0;
    text-decoration: none;
    font-weight: bold;
    background-image: url(index_file/sfondomenu.JPG);
    }

    #dropmenudiv a:hover{ /*hover background color*/
    background-image: url(index_file/sfondomenuon.JPG);
    }

  5. #5
    Utente di HTML.it L'avatar di nuky
    Registrato dal
    Oct 2001
    Messaggi
    1,053
    E' il contrario, l'iframe allunga il div. Prova a mettere l'altezza dell'iframe a 100px e il bordo al container.
    Per far si che l'iframe allunghi al massimo il container basta che forzi la "non presenza" delle scrollbar:
    <iframe scrolling="no"
    - "E' un messaggio. E' di Svarion, della terra di Merdor!"
    - "Busto Arsizio?"
    - "Terrazzo, sgabello, formaggio. Borraccia blu, ca**o di gomma e... CANNUCCIA!"
    - "Ca**o dici? C'è scritto «frocio chi legge»!"

  6. #6
    Utente di HTML.it
    Registrato dal
    Jan 2004
    Messaggi
    24
    forse volevi dire 100percento, comunque non funziona, credo che sia perchè acquisisce qualche prorpietà dalla pagina in cui risiede (infatti con lo sfondo ha fatto proprio cosi!)
    come fare?

  7. #7
    Utente di HTML.it L'avatar di nuky
    Registrato dal
    Oct 2001
    Messaggi
    1,053
    Originariamente inviato da AleCiri
    forse volevi dire 100percento, comunque non funziona, credo che sia perchè acquisisce qualche prorpietà dalla pagina in cui risiede (infatti con lo sfondo ha fatto proprio cosi!)
    come fare?
    No, dicevo proprio 100px, 10px, insomma, fallo più piccolo della pagina, vedrai che il div container (mettici il bordo visibile) sarà alto come il body appunto perché hai impostato l'altezza al 100%.
    Mettendo dentro al container un oggetto più grande del body ottieni l'allungamento dello stesso div (se il contenuto è più grande del contenitore quest'ultimo o si allunga o compaiono le scrollbar, ma il div di default non le ha, quindi si allunga).
    Questa era solo una prova per farti capire il funzionamento.
    L'unica modifica che devi fare sul codice che hai postato è questa:
    <iframe scrolling="no"
    - "E' un messaggio. E' di Svarion, della terra di Merdor!"
    - "Busto Arsizio?"
    - "Terrazzo, sgabello, formaggio. Borraccia blu, ca**o di gomma e... CANNUCCIA!"
    - "Ca**o dici? C'è scritto «frocio chi legge»!"

  8. #8
    Utente di HTML.it
    Registrato dal
    Jan 2004
    Messaggi
    24
    ok ho fatto la prova del 9:
    ho caricato i contenuti scrivendoli direttamente nella pagina e il tutto si allunga, ho caricato una pagina con gli stessi contenuti nell'iframe (senza proprietà, solo scrolling="no") e non si allunga(rimane di circa 100px)!!
    vol dire che il problema è un'altro, secondo me è l'iframe che ha qualche altra proprietà..

  9. #9
    Utente di HTML.it
    Registrato dal
    Jan 2004
    Messaggi
    24
    ho risolto: nel forum c'era gia stata una discussione simile e ho risolto reimpostando attraverso le javascript l'altezza dell'iframe!!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.