← Tutoriais

Frames Extensiveis

Lida 3256 vezes

Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Boas.

Alguém me arranja um código para fazer as frames estenderem de acordo com tamanho da página HTML?

Obrigado.
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Então pessoal?

Ninguém sabe ajudar?
Offline

bfms 
Equipa
Mensagens 1769 Gostos 40
Feedback +1

Troféus totais: 35
Trófeus: (Ver todos)
Search Level 6 Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Tem calma Thomato, alguém havia de responder...

Segundo percebi queres fazer com que a frame ocupe a largura total do ecrã consoante a resolução do mesmo, certo?
Ou é isso ou então tens uma página com 900px e queres um frame que ocupe o tamanho total dessa página.

Em ambos os casos tens de meter:
Código: [Seleccione]
<iframe src="LINK-DA-PAGINA.PHP" style="width:100%;"></iframe>

Em alguns casos podes ter problemas com a altura, se pretendes o mesmo para a altura:
Código: [Seleccione]
<iframe src="LINK-DA-PAGINA.PHP" style="width:100%;height:100%;"></iframe>

Espero ter ajudado ;)
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

bfms, não é isso que eu preciso.

Eu preciso de algo como http://techway.blogui.net para que quando clicas no menu ele abrir uma página e dependendo do tamanho da página que abre, a frame estende ou encolhe.

Já falei com o dono mas o script que ele usa é só num programa estranho que pode ser mexido...
Offline

skin 
Membro
Mensagens 200 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Avatar Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

<script type="text/javascript">
//<![CDATA[
window.onload = function() {
var f = document.getElementById("mainframe");//Sets iframe id
function resize() { //Starts resize function
var h = "";
var w = "";
if (f.contentDocument) {
h = f.contentDocument.documentElement.offsetHeight + 20 + "px";
// can't find anything for Opera and Firefox that works for the width. OffetWidth doesn't work right either.(f.contentDocument.documentElement,"").getPropertyValue("width");
} else if (f.contentWindow) {
h = f.contentWindow.document.body.scrollHeight + 5 + "px";
} else {
return;
}
f.setAttribute("height",h);
f.parentNode.setAttribute("height",h);
}
if (window.addEventListener) {
f.onload = resize;
} else if (f.attachEvent) {
f.attachEvent("onload", resize);
} else {
return;
}
resize(); //starts resize function that was coded further up the code
}
//]]>
</script>
<iframe name="mainframe" id="mainframe" src="home.html" width="100%" frameborder="0" allowtransparency="yes" scrolling="No"></iframe>

É este o código que o site que indicaste utiliza, só tens de adaptar ao que tu queres ;)
Qualquer dúvida é só perguntares
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Hey!

Skin, esse já tinha experimentado usar e não deu. Mas eu acho que fiz uma coisa mal. Agora estou a trabalhar, quando tiver tempo já vejo isso ;) Obrigado
Offline

skin 
Membro
Mensagens 200 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Avatar Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Tem de funcionar, se calhar fizeste algum pequeno erro de sintax, é normal acontecer e são dificeis de encontrar :p