Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom Galera,
Então estou tentando fazer uma pagina com AUTO-HEIGHT só que não está funcionando com o IE. Alguem já utilizou o plugin JQUERY para isso?
Segue abaixo os códigos .php e .js.
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml"](http://www.w3.org/1999/xhtml) xml:lang="pt-br">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="google-site-verification" content="BdFqmwV8flGxGPvABWkl33H3NIw7QNcnSQMBoUAWNJ4" />
<meta name="description" content="w3is, all-in-one, virtualização, ti, verde, informatica" />
<meta name="robots" content="index,follow" />
<meta name="author" content="Lincoln Rocha Nogueira" />
<title>w3is - Solução Ideal para a sua Empresa</title>
<script type="text/javascript" src="js/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="js/jquery.iframe-auto-height.plugin.js"></script>
<link rel="shortcut icon" href="imagens/favicon.ico" />
<link rel="stylesheet" type="text/css" media="all" href="css/index.css" />
</head>
<body>
<div id="tudo">
<div id="linha1">
<div id="menu1">
<img alt="" src="imagens/Figura1.jpg" width="300" height="90"></img>
</div>
<div id="menu2">
<div class="bordaBox">
<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
<div class="conteudo"><p class="text">
<a href="principal.php" target="myframe">HOME</a> |
<a href="empresa.php" target="myframe">EMPRESA</a> |
<a href="solucoes.php" target="myframe">SOLUÇÕES</a> |
<a href="produtos.php" target="myframe">PROMOÇÕES</a> |
<a href="contato.php" target="myframe">CONTATO</a></p>
</div>
<b class="b4"></b><b class="b3"></b><b class="b2"></b><b class="b1"></b>
</div>
</div>
</div>
<div id="linha2">
<iframe width="950" id="myframe" name="myframe" scrolling="auto" frameborder="0" src="principal.php"></iframe>
<script type="text/javascript">
jQuery('iframe').iframeAutoHeight();
</script>
</div>
<div id="linha3">
<div id="rodape1">
<a href="[http://www.facebook.com/?ref=home#!/profile.php?id=100001531389195"](http://www.facebook.com/?ref=home#!/profile.php?id=100001531389195) target="_blank"><img alt="Facebook" src="imagens/facebook-logo.png" width="55" height="55"/></a>
<a href="[http://www.twitter.com/lw3is"](http://www.twitter.com/lw3is) target="_blank"><img alt="Twitter" src="imagens/twitter-logo.png" width="55" height="55"/></a>
<a href="[http://www.formspring.me/w3is"](http://www.formspring.me/w3is) target="_blank"><img alt="FormSpring ME" src="imagens/formspring_logo.png" width="130" height="28"/></a>
<a href="[http://www.youtube.com/user/w3isti"](http://www.youtube.com/user/w3isti) target="_blank"><img alt="Youtube" src="imagens/youtube.png" width="95" height="50"/></a>
<a href="[http://jigsaw.w3.org/css-validator/check/referer">http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" media="all" href="css/principal.css" />
</head>
<body>
<div id="tudo">
<div id="linha">
<object width="860" height="200">
<param name="movie" value="site.swf">
<embed src="site.swf" width="860" height="200">
</embed>
</object>
</div>
<div id="linha">
<div id="linha1">
<div id="colesq">
<p class="tit">Outsourcing</p>
<p class="text">
O outsourcing é a forma eficaz e estratégica de controlar operações, reduzir custos, obter recursos especializados, obter mais produtividade, valor agregado e acesso privilegiado às últimas tecnologias do mercado.</p>
<a href="outsourcing.php" target="myframe">Veja Mais>> </a>
</div>
<div id="colcen">
<p class="tit">Nossa Empresa</p><p class="text">
A w3is é uma empresa que oferece soluções integradas em tecnologia. Nosso foco é atender a demandas de empresas através de soluções tecnologicamente confiáveis.
</p><a href="empresa.php" target="myframe">Veja Mais>> </a>
</div>
<div id="coldir">
<p class="tit">TI VERDE</p><p class="text">
Ti Verde é que a prática sustentável de produção, gerenciamento e descarte dos equipamentos eletrônicos, bem como economia de energia elétrica.
</p>
<a href="tiverde.php" target="myframe">Veja Mais>> </a></div>
</div>
<div id="navegacao">
<div class="bordaBox">
<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
<div class="conteudo">
<a href="news.php" target="myframe">News</a>
</div>
<b class="b4"></b><b class="b3"></b><b class="b2"></b><b class="b1"></b>
</div>
</div>
</div>
</div>
</body>
</html>
/*
Plugin: iframe autoheight jQuery Plugin
Author: original code by NATHAN SMITH; converted to plugin by Jesse House
File: jquery.iframe-auto-height.plugin.js
Description: when the page loads set the height of an iframe based on the height of its contents
Remarks: original code from http://sonspring.com/journal/jquery-iframe-sizing
Version: 1.0.0 - see README: http://github.com/house9/jquery-iframe-auto-height
*/
(function ($) {
$.fn.iframeAutoHeight = function (options) {
// set default option values
var options = $.extend({
heightOffset: 0
}, options);
// iterate over the matched elements passed to the plugin
$(this).each(function () {
// Check if browser is Opera or Safari(Webkit so Chrome as well)
if ($.browser.safari || $.browser.opera) {
// Start timer when loaded.
$(this).load(function () {
var iframe = this;
var delayedResize = function () {
resizeHeight(iframe);
};
setTimeout(delayedResize, 0);
});
// Safari and Opera need a kick-start.
var source = $(this).attr('src');
$(this).attr('src', '');
$(this).attr('src', source);
}
else {
// For other browsers.
$(this).load(function () {
resizeHeight(this);
});
}
// resizeHeight
function resizeHeight(iframe) {
// Set inline style to equal the body height of the iframed content plus a little
var newHeight = iframe.contentWindow.document.body.offsetHeight + options.heightOffset;
iframe.style.height = newHeight + 'px';
}
}); // end
}
})(jQuery);
Quem puder me ajudar....
Vou ficar aguardando...
Carregando comentários...