Ir para conteúdo
Fórum Script Brasil
  • 0

Pre-load De Uma Página


renatacm

Pergunta

8 respostass a esta questão

Posts Recomendados

  • 0

não deu pra entender seu código se quer fazer um efeito de load...

mias colocando eel dentro de um iframe pra isso ele tem que ser executado lá dentro se ele executa do lado de fora

bom não deu pra entender seu código

você quer fazer o load... dentro de um iframe depois que acabado ele chama a página dentro desse iframe mesmo?

Link para o comentário
Compartilhar em outros sites

  • 0

Oi, Deividy...

Imgina o exemplo que postei do iMaters... é exatamente aquilo que está lá, só que no exemplo ele faz o preload da página inicial de um site, pra mim, tem que ser um preload de uma página interna que está sendo aberta num iframe...

Eu faço uma consulta muito grande no DB Access e o resultado é apresentado dentro de um iframe numa subpágina do site...

(Se quiser ver o que quero fazer, acesse Teste e monte uma pesquisa... Depois que você selecionar os critérios, o siste vai apresentar uma tabela com uma lista dos imóveis que se encaixam nos critérios que você selecionou... Essa lista (chamada por um iframe) pode ser demorada pra ser montada dependendo do tamanho do banco e dos critérios utilizados... Eu quero fazer um preload dessa lista, apresentar uma mensagem "Aguarde enqto processamos..." algo assim...

Tentei como recurso de camadas, mas não tá dando certo...

;oÞ

Link para o comentário
Compartilhar em outros sites

  • 0

então a busca é realizada dentro de um iframe e o resultado vai aparecer dentro dele, ou a busca é realizada fora do iframe

coloca esse esquema dentro do iframe!

tem uma função em asp que conta o tempo de uma página abrir isso pode lhe ajudar!!!

existe um script em javascript que faz isso tambem acho que pode ser melhor do que isso que você esta tentando fazer!

se eu encontrar posto aqui pra vc!

Link para o comentário
Compartilhar em outros sites

  • 0

achei

<div id="splashcontainer" style="position:absolute;width:700; left: 380px"></div>

<layer id="splashcontainerns" width=790 height="19" left="396"></layer>


<script>

var intervals=250 
var targetdestination="http://www.volpicarvalho.com.br" 

var splashmessage=new Array()
var openingtags='<font face="Verdana" size="1" color=#333333><b>' 
splashmessage[0]="carregando . 5%" 
splashmessage[1]="carregando .. 10%"
splashmessage[2]="carregando ... 15%"
splashmessage[3]="carregando .... 20%"
splashmessage[4]="carregando ..... 25%"
splashmessage[5]="carregando ...... 30%"
splashmessage[6]="carregando ....... 35%"
splashmessage[7]="carregando ........ 40%"
splashmessage[8]="carregando ......... 45%"
splashmessage[9]="carregando .......... 50%"
splashmessage[10]="carregando ........... 55%"
splashmessage[11]="carregando ............ 60%"
splashmessage[12]="carregando ............. 65%"
splashmessage[13]="carregando .............. 70%"
splashmessage[14]="carregando ............... 75%"
splashmessage[15]="carregando ................ 80%"
splashmessage[16]="carregando ................. 85%"
splashmessage[17]="carregando .................. 90%"
splashmessage[18]="carregando ................... 95%"
splashmessage[19]="carregando .................... 100%"

var closingtags='</font>'

var i=0

function displaysplash_ie(){
if (i<splashmessage.length){
sc_ie.style.visibility="hidden"
sc_ie.innerHTML='<b><center>'+openingtags+splashmessage[i]+closingtags+'</center></b>'
sc_ie.style.top=document.body.scrollTop+document.body.clientHeight/2-sc_ie.offsetHeight/2
sc_ie.style.visibility="visible"
i++
}
else{
window.location=targetdestination
return
}
setTimeout("displaysplash_ie()",intervals)
}

function displaysplash_ns(){
if (i<splashmessage.length){
sc_ns.visibility="hide"
sc_ns.document.write('<b>'+openingtags+splashmessage[i]+closingtags+'</b>')
sc_ns.document.close()

sc_ns.left=pageXOffset+window.innerWidth/2-sc_ns.document.width/2
sc_ns.top=pageYOffset+window.innerHeight/2-sc_ns.document.height/2

sc_ns.visibility="show"
i++
}
else{
window.location=targetdestination
return
}
setTimeout("displaysplash_ns()",intervals)
}



function positionsplashcontainer(){
if (document.all){
sc_ie=document.all.splashcontainer
sc_ie.style.left=document.body.scrollLeft+document.body.clientWidth/2-sc_ie.offsetWidth/2
sc_ie.style.top=document.body.scrollTop+document.body.clientHeight/2-sc_ie.offsetHeight/2
displaysplash_ie()
}
else if (document.layers){
sc_ns=document.splashcontainerns
sc_ns.left=pageXOffset+window.innerWidth/2-sc_ns.document.width/2
sc_ns.top=pageYOffset+window.innerHeight/2-sc_ns.document.height/2
sc_ns.visibility="show"
displaysplash_ns()
}
else
window.location=targetdestination
}
window.onload=positionsplashcontainer

</script>

Link para o comentário
Compartilhar em outros sites

  • 0

Achei um script interessante na net sobre "preload"


<!-- TWO STEPS TO INSTALL PROGRESS DIALOG:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

<!-- Style for layers -->
<style>
.hide { position:absolute; visibility:hidden; }
.show { position:absolute; visibility:visible; }
</style>

<script LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var _progressBar = new String("");
var _progressEnd = 10;
var _progressAt = 0;
var _progressWidth = 50;	// Display width of progress bar

// Create and display the progress dialog.
// end: The number of steps to completion
function ProgressCreate(end) {
	// Initialize state variables
	_progressEnd = end;
	_progressAt = 0;

	// Move layer to center of window to show
	if (document.all) {	// Internet Explorer
  progress.className = 'show';
  progress.style.left = (document.body.clientWidth/2) - (progress.offsetWidth/2);
  progress.style.top = (document.body.clientHeight/2) - (progress.offsetHeight/2);
	} else if (document.layers) {	// Netscape
  document.progress.visibility = true;
  document.progress.left = (window.innerWidth/2) - 100;
  document.progress.top = (window.innerHeight/2) - 40;
	}

	ProgressUpdate();	// Initialize bar
}

// Hide the progress layer
function ProgressDestroy() {
	// Move off screen to hide
	if (document.all) {	// Internet Explorer
  progress.className = 'hide';
	} else if (document.layers) {	// Netscape
  document.progress.visibility = false;
	}
}

// Increment the progress dialog one step
function ProgressStepIt() {
	_progressAt++;
	if(_progressAt > _progressEnd) _progressAt = _progressAt % _progressEnd;
	ProgressUpdate();
}

// Update the progress dialog with the current state
function ProgressUpdate() {
	var n = (_progressWidth / _progressEnd) * _progressAt;
	if (document.all) {	// Internet Explorer
  var bar = dialog.bar;
  } else if (document.layers) {	// Netscape
  var bar = document.layers["progress"].document.forms["dialog"].bar;
  n = n * 0.55;	// characters are larger
	}
	var temp = _progressBar.substring(0, n);
	bar.value = temp;
}

// Demonstrate a use of the progress dialog.
function Demo() {
	ProgressCreate(10);
	window.setTimeout("Click()", 100);
}

function Click() {
	if(_progressAt >= _progressEnd) {
  ProgressDestroy();
  return;
	}
	ProgressStepIt();
	window.setTimeout("Click()", 500);
}

function CallJS(jsStr) { //v2.0
  return eval(jsStr)
}
//  End -->
</script>

<link href="Js/style.css" rel="stylesheet" type="text/css">
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->

<BODY>

<script LANGUAGE="JavaScript" class="box-branco-modal-2">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Create layer for progress dialog
document.write("<span id=\"progress\" class=\"hide\">");
	document.write("<FORM name=dialog>");
	document.write("<TABLE border=0  bgcolor=\"#ffffff\">");
	document.write("<TR><TD ALIGN=\"center\" class=\"arial-preto-8\">");
	document.write("Carregando Sistema<BR>");
	document.write("<input type=text class=\"box-branco-modal-2\" name=\"bar\" size=\"" + _progressWidth/2 + "\"");
	if(document.all)  // Microsoft
  document.write(" bar.style=\"color:navy;\">");
	else	// Netscape
  document.write(">");
	document.write("</TD></TR>");
	document.write("</TABLE>");
	document.write("</FORM>");
document.write("</span>");
ProgressDestroy();	// Hides
//  End -->
</script>

When you click the "Demo" button a progress dialog will appear. The dialog
is centered over the window. Each half-second the progress bar will increment.
After 5 seconds the progress dialog will disappear.
<form name="form1" method="post" action="">
<center>
<input type="button" name="Demo" value="Demo" onClick="CallJS('Demo()')">
</center>
</form>


<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size:  4.27 KB -->

Bjocas...

;oÞ

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652,1k
×
×
  • Criar Novo...