Jump to content


Photo

Como Ajustar Iframe De Acordo Com Conteudo


  • Faça o login para participar
9 replies to this topic

#1 {TeRmInAtOr}

{TeRmInAtOr}

    12 Horas

  • Usuários
  • 174 posts
  • Sexo:Masculino
  • Localidade:New Hamburgo, RS

Posted 21/11/2004, 10:33

Ae glr to tentando fazer um eskema que ajuste o tamanho de um iframe de acordo com o tamanho do conteudo da página setada nele.
Achei este codigo ae, mas nao tah funcionando diretio, naõ sei se esta certo!

function resizeFrame(parentName, childName, offsetHeight)
{
  var isInternetExplorer = (document.all) ? true : false;
  var ns6_mozilla = (document.getElementById) ? true : false;
  
  //if Macintosh
  if (navigator.platform.indexOf('Mac') != -1) {
    //if Internet Explorer
    if (isInternetExplorer) {
      var parent = eval("document.all."+parentName);
      var child = eval(childName+"document.documentElement");
      offsetHeight *= 2;
      parent.height=child.offsetHeight+offsetHeight;
    }
    else if (ns6_mozilla) {
      var parent = eval("document.getElementById(\""+parentName+"\")");
      var child = eval(childName+".document.body");
      offsetHeight *= 5;
      parent.height=child.offsetHeight+offsetHeight;
    }
  }
  else {
    //if Internet Explorer
    if (isInternetExplorer) {
      var parent = eval("document.all."+parentName);
      var child = eval(childName+".document.body");
      parent.height=child.scrollHeight+offsetHeight;
      parent.scrolling="no";
    }
    //if at least Netscape 6 or Mozilla
    else if (ns6_mozilla) {
      var parent = eval("document.getElementById(\""+parentName+"\")");
      var child = eval(childName+".document.body");
      if (navigator.userAgent.indexOf('Netscape') != -1) {
        // Appearantly netscape refuse to remove scrollbars unless a new default height is set. =/
        parent.height=1;
      }
      parent.height=child.offsetHeight + offsetHeight;
      parent.scrolling="no";
      parent.scrollbars="no";
    }
  }
}

Na pagina que abrira no iframe
 <script>
 function adjustSize()
{
  try {
    parent.resizeFrame("calendar", "calendar", 0);
  } catch(error) {}
}
 </script>
<body onload="javascript: adjustSize();">

Alguem pode ajudar?

#2 Klaus

Klaus

    @ ubuntu jaunty

  • Ex-Admins
  • 7924 posts
  • Sexo:Masculino
  • Localidade:127.0.0.1

Posted 21/11/2004, 10:44

http://forum.wmonlin...r/index.php?...
Klaus Paiva
Conheça também: Taperás

#3 tgbgyn2006

tgbgyn2006

    Novato no fórum

  • Usuários
  • 5 posts
  • Sexo:Não informado

Posted 15/03/2009, 00:46

FIZ UM EXEMPLO COM IMPRENSÃO DE FOTO MAS O IFRAME SE AJUSTA DE ACORDO COM A FOTO TALVEZ ELE POSSA AJUDAR:
DOWNLOAD DO EXEMPLO

BOM ESPERO TER AJUDADO ALGUEM COM ESSE EXEMPLO, ATE MAIS, QUALQUER DUVIDA É SÓ ENTRAR EM CONTATO PELO EMAIL NO EXEMPLO......

#4 Cristiano Galdino

Cristiano Galdino

    Dark Defender

  • Administradores
  • 3738 posts
  • Sexo:Masculino
  • Localidade:Brasília, DF

Posted 15/03/2009, 02:32

É... 2004.
Cristiano Galdino
- http://cristiano.galdino.net/

“Since 2003”


#5 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 26/09/2017, 19:17

In Half Amoxicillin online pharmacy Pharmacy Rx One Coupon
Bayer Brand Name Levitra online pharmacy Metronidazole For Dogs No Rx Zithromax At Walgreens Online Generic Viagra
Cheap Cialis And Viagra Buy Vigora 100 cialis Combine Cephalexin And Darvocet

#6 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 29/10/2017, 06:59

Cialis Effet Heure Acheter Cialis Pas Cher Paris buy viagra online Zithromax Dosage For Gonorrhea
Buy Vardenafil Online Cheap Viagra Efectos Secundarios Jovenes Doxycycline Without Prescription levitra non prescription Cialis Tous Les Jours Synthroid Without A Script

#7 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 29/10/2017, 10:37

Dosing Amoxicillin In Humans buy accutane online from canada Kamagra Tabletten Preisvergleich cialis Do I Need Prescription For Cialis Kamagra Oral Jelly Usa
Cialis Generique 40 Mg Teilbar Levitra Rezeptfrei Levitra Fertilita generic viagra Cialis Accion Terapeutica Propecia Clasificacion Cialis Effet Forum
Cialis Tadalafil Precio viagra Rx Elife Acheter Cialis Generique En Ligne
Amoxicillin For Chlamydia Cialis Sito Ufficiale viagra Propecia Efectivo Principio Activo

#8 HaroNism

HaroNism

    Super Veterano

  • Usuários
  • 15385 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 29/10/2017, 13:06

Acheter Du Propecia France Finpecia Canada buy viagra online Cialis Tablets 10mg Viagra In Canada For Sale

#9 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 16/11/2017, 15:41

Canadian Ed Meds buy claravis accutane Buy Xenical And Reductil viagra online Cialis Apotheke Online
Levitra 10 Mg Usato Where To Order Stendra In Australia Cash Delivery Viagra Rezeptfrei Kaufen Billig viagra Comprar Cialis 5 Mg Online Duree Efficacite Viagra

#10 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 16/11/2017, 17:43

Buy Tadalista Keflex Foot Fungus Pictures Of Amoxicillin Rash cheap levitra canada Buy Now Clobetasol Internet




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq