Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

meop

[Resolvido] Scrolling em Frames

Recommended Posts

Opa pessoal, beleza?

 

seguinte, to com um problema aqui q esta me deixando doido, fiquei o dia todo tentando resolver isso, google e o kralhoa4 e nda.

 

Estou montando um site com 4 frames: topo, menu, central e lateral direito. Acontece q as noticias serao atualizadas no frame central (main frame) mas o scroll fica feio se somente neste frame, gostaria de deixar o scroll na pagina toda sem ser um frame só. Sei q isto deve ser facil, mas ja estou ficando doido.

 

 

 

Olhem ai o codigo:

<frameset rows="*" cols="30%,800px,30%" SCROLLING="YES" framespacing="0" frameborder="no" border="0" align="center">	  <frame src="back.html"/>			  <frameset rows="100px,500px" cols="*" frameborder="no" scrolling="YES" order="0" framespacing="0">		<frame src="topo.html" name="topFrame" scrolling="no" noresize="noresize" id="topFrame" title="topFrame" />					<frameset rows="*" cols="130,535,135" scrolling="yes" framespacing="2" frameborder="no" border="0">						  <frame src="menu2.html" name="leftFrame" scrolling="no" noresize="noresize" id="leftFrame" title="leftFrame" />						<frame src="main.html" name="mainFrame" scrolling="no" id="mainFrame" title="meio" />						<frame src="news.html" name="rightFrame" scrolling="no" id="rightFrame" title="rightFrame" />			  </frameset></frameset>	  <frame src="back.html"></frameset><noframes></noframes></frameset>

Os que estao com o scrolling YES eram o q eu gostaria q funcionassem. Caso alguem repare há alguns scrolling's em NO; ja tentei deixar em yes mas com isso vai ficar um scrollbar pra cada frame.

 

 

 

Esperando desesperadamente por alguma luz

 

[]'s

meop

Compartilhar este post


Link para o post
Compartilhar em outros sites

bom pessoal, não obtive respostas mas depois de 2 dias tentando consegui uma gambiarra em java pra poder fazer os frames descerem juntos.

Caso alguém se depare com a mesma situação que eu olha ai a solução:

 

é só colocar o scrolling no frame que você deseja q os outros sigam e colocar esse java:

 

modificando o nome mainFrame pelo nome do frame que você quer q ele siga.

 

<script>if(navigator.userAgent.indexOf("Firefox")!=-1||navigator.appName=="Microsoft Internet Explorer"){_run=false;}else {_run= true;}/* In the above lines of code, we’re checking to make sure the person is using either Mozilla FireBird or Microsoft Internet Explorer. We’ll set our global variable to false if they are using it, or set it to true in the event that someone is using Netscape or Opera (or some other unpopular browser). This variable will tell us which function to run. */function vScroll() // begin function{var top = (window.pageYOffset)?(window.pageYOffset):(document.documentElement)?document.documentElement.scrollTop:document.body.scrollTop;/* An explanation is needed here: the variable “top” is going to represent one of three things: window.pageYOffset (if it is available, if it’s not, it represents document.documentElement.scrollTop. If document.documentElement is not available, it will represent document.body.scrollTop (sound familiar?). This is the variable we’ll use to determine the amount of pixels this document is scrolled from the top. It’s important because it tells us where we should put the frame on the mainFrame. */parent.frames["mainFrame"].scrollTo(0,top);/* This code will make the mainFrame frame (remember its ID in the fscroll_main.html page?) scroll to zero horizontally, and the same place as this left frame vertically. */} // End functionfunction searchScroll(){ // begin functionvar top = (window.pageYOffset)?(window.pageYOffset):(document.documentElement)?document.documentElement.scrollTop:document.body.scrollTop;/* Again, we’re setting the variable top to equal that of the amount of pixels the document is scrolled from the top. The reason for not declaring this variable once (before any functions were put into the code), is because you wouldn’t be able to scroll either document! This variable would always equal zero. By putting it into the function, the variable re-validates each time, resulting in a different number (assuming the document was scrolled up or down). */parent.frames["mainFrame"].scrollTo(0,top);/* This code places the scrolling of the mainFrame frame in the same place as the left frame. Keep in mind that if you’ve scrolled horizontally, it will go back to zero. */window.setTimeout("searchScroll();",1);/* Why a setTimeout function? We’re going to re-run this function 1000 times a second. The scrolling might appear a bit choppy if you do it really fast, but it doesn’t work in Netscape otherwise. */}if(_run == false) // if the browser is Mozilla FireBird or if it’s Internet Explorer…{window.onscroll=function(){vScroll();} // when the document is scrolled, run the function specified.} else { // If the browser is not Mozilla FireBird or Internet Explorer…window.onload=function(){searchScroll()} // when the document loads, run the function specified. Remember we’re using a setTimeout function with this function, because it takes place when the document loads, not when it is scrolled (some browsers do not support the window.onscroll event handler).}</script>

Fonte

Compartilhar este post


Link para o post
Compartilhar em outros sites

Boa Noite meop!

Parabéns pela atitude de retornar e postar a solução, já que não obteve resposta no seu tópico.

Qualquer nova dúvida post, que sempre na medida do possivel o pessoal ajuda. http://forum.imasters.com.br/public/style_emoticons/default/thumbsup.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.