Jump to content


zerocool

Member Since 14/04/2007
Offline Last Active 23/03/2008, 02:56
-----

Posts I've Made

In Topic: Div Flutuante

25/06/2007, 22:20

Bom existem 2 metodos q eu utilizo o 1º eh o por CSS e o 2º por javascript
o 1º :


no style da div deve ser por
position:fixed;
top:[color="#FF0000"]50px[/color];
left:[color="#FF0000"]150px[/color];
// mude soh onde esta em vermelho para o valor em px ou em %(prefira em %)
estude CSS

para q ele funcione na pagina em q vc utilizar ele deve ter o tipo de documento

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
pois esse metodo naum eh reconhecido pelo IE sem esse DOCTYPE ou outro DOCTYPE(naum testei)



o 2º metodo(javascript)

<script language="JavaScript">
		Microsoft = (document.all)? true:false
		function CalcularPosicao(){
			if(Microsoft){
				LarguraSite=760;
				document.body.onresize = function(){start();}
				document.body.onload = function(){start();}
				windowwidth = document.body.clientWidth;
				EspacoLivre=document.body.clientWidth-LarguraSite;
				posicaoCamada = EspacoLivre/2;
				Altura=screen.availHeight;
				Largura=screen.availWidth;
			}
			else{
				LarguraSite=780;
				window.onresize = function(){start();}
				window.onload = function(){start();}
				windowwidth = window.innerWidth;
				EspacoLivre=window.innerWidth-LarguraSite;
				posicaoCamada = EspacoLivre/2;
				Altura=window.innerHeight;
				Largura=screen.availWidth;
			}
		}
		
		
		var ns6 = (!document.all && document.getElementById);
		var ie4 = (document.all);
		var ns4 = (document.layers);
		
		function getValuesByBrowser() {
			if (ns6) {
				this.vobj = new Object();
				this.vobj.topMargin = 150;
				this.vobj.slideTime = 1200;
				return this.vobj;
			} else if(ie4) {
				this.vobj = new Object();
				this.vobj.topMargin = 100;
				this.vobj.slideTime = 1200;
				return this.vobj;
			} else if(ns4) {
				this.vobj = new Object();
				this.vobj.topMargin = 150;
				this.vobj.slideTime = 1200;
				return this.vobj;
	   	}
		}
		
		window.onerror = null;
		var topMargin = getValuesByBrowser().topMargin;
		var slideTime = getValuesByBrowser().slideTime;
		
		function layerObject(id,left) {
			if (ns6) {
				this.obj = document.getElementById(id).style;
				this.obj.left = 200;
				this.obj.width = 163;
				return this.obj;
			} else if(ie4) {
				this.obj = document.all[id].style;
				this.obj.left = 200;
				this.obj.width = 169;
				return this.obj;
			} else if(ns4) {
				this.obj = document.layers[id];
				this.obj.left = 200;
				this.obj.width = 163;
				return this.obj;
	   	}
		}
		function layerSetup() {
			floatLyr = new layerObject('divflutuante', posicaoCamada);
			window.setInterval("main()", 10)
		}
		function floatObject() {
			if (ns4 || ns6) {
				findHt = window.innerHeight;
			} 
			else if(ie4) {
				findHt = document.body.clientHeight;
	   			}
		} 
		function main() {
			if (ns4) {
				this.currentY = document.layers["divflutuante"].top;
				this.scrollTop = window.pageYOffset;
				mainTrigger();
			}
			else if(ns6) {
				this.currentY = parseInt(document.getElementById('divflutuante').style.top);
				this.scrollTop = scrollY;
				mainTrigger();
			} else if(ie4) {
				this.currentY = divflutuante.style.pixelTop;
				this.scrollTop = document.body.scrollTop;
				mainTrigger();
			   }
		}
		function mainTrigger() {
			var newTargetY = this.scrollTop + this.topMargin;
			if ( this.currentY != newTargetY ) {
				if ( newTargetY != this.targetY ) {
					this.targetY = newTargetY;
					floatStart();
				}
				animator();
	   		}
		}
		function floatStart() {
			var now = new Date();
			this.A = this.targetY - this.currentY;
			this.B = Math.PI / ( 2 * this.slideTime );
			this.C = now.getTime();
			if (Math.abs(this.A) > this.findHt) {
				this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt;
				this.A = this.A > 0 ? this.findHt : -this.findHt;
			}
			else {
				this.D = this.currentY;
	   		}
		}
		function animator() {
			var now = new Date();
			var newY = this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D;
			newY = Math.round(newY);
			if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) {
				if ( ie4 )document.all.divflutuante.style.pixelTop = newY;
				if ( ns4 )document.layers["divflutuante"].top = newY;
				if ( ns6 )document.getElementById('divflutuante').style.top = newY + "px";
			 }
		}
		function start() {
			CalcularPosicao();
			if(ns6||ns4) {
				pageWidth = innerWidth;
				pageHeight = innerHeight;
				layerSetup();
				floatObject();
			}
			else if(ie4) {
				pageWidth = document.body.clientWidth;
				pageHeight = document.body.clientHeight;
				layerSetup();
				floatObject();
		   }
		}
		start();
	</script>


Sua div deve ter id =
divflutuante"
e o z-index dela ser maior do q d todos os elementos da pagina




para mudar as posiçoes da div como left,top edite essa parte do codigo:


function layerObject(id,left) {
if (ns6) {
this.obj = document.getElementById(id).style;
this.obj.left = 200;
this.obj.width = 163;
return this.obj;
} else if(ie4) {
this.obj = document.all[id].style;
this.obj.left = 200;
this.obj.width = 169;
return this.obj;
} else if(ns4) {
this.obj = document.layers[id];
this.obj.left = 200;
this.obj.width = 163;
return this.obj;
}


observe q tem 3 posiçoes sendo uma para internet explorer outra pra netscape 4 e mozilla e outra para netscape 6
verifique q c vc coloca as msm posiçoes para os 3 e visualizar nos 3 ver a diferenças

In Topic: Contador De Caracteres

25/05/2007, 22:03

&lt;script type="text/javascript">
function contador(opt_boxcontado, opt_contarcorpo, opt_valormax) {
  var boxcontado = opt_boxcontado ? opt_boxcontado : "boxcontado";
  var contarcorpo = opt_contarcorpo ? opt_contarcorpo : "corpocontador";
  var valormax = opt_valormax ? opt_valormax : 150;
	
  var field = document.getElementById(boxcontado);
  if (field && field.value.length >= valormax) {
	field.value = field.value.substring(0, valormax);
  }
  var txtField = document.getElementById(contarcorpo);
  if (txtField) {  
	txtField.innerHTML = field.value.length;
  }
}
</script>

para chamar o contador :
<textarea id="boxcontado" style="width: 100%;" rows="4" onkeypress="contador();" onkeyup="contador();" onkeydown="contador();"></textarea>
Seu texto contém <b><span id="corpocontador">0</span></b> caracteres

In Topic: Montando Um Servidor De Hospedagem

14/04/2007, 23:20

:lol: aew pessoal vou tentar explicar
q eu saiba o iis suporta asp(não necessita nenhuma instalaçãoa +) asp.net(baxar e ins o asp.net) e php(baixe o arquivo binnary do php no site www.php.net em downloads) as outra aind naum testei

c vcs usam adsl ou intenet discada seu ip muda a toda nova conexão intaum vc devem c cadastrar no NO-IP criarem um host do tipo A e baixar o programa do no-ip
mtu proveores bloqueiam a porta 80 pra evitar q vc faça um servidor e publique seu site intaum vah no progrma do NO-IP e option selecione o 2º checkbox (caso vc tenha problema com a porta....)
mas o iis esta configurado para a porta 80 naum eh então como eu mudo?
vah no painel de controle do pc entre em ferramentas admins e internet information services

abra o nó (nome do pc) - sites da web
na janela da direita click com o botão direito e em propriedades
mude a porta para o numero q o no-ip solicita
8245
apos salvar
testem o site
http://localhost:8245 ou
http://seusitenoip.no-ip.org(no meu caso):8245
c funcionou eh pq tah tudo certinhu
agora devemos permitir q os outros possam acessar essa porta como?
vah no painel de controle e click em firewall do windows
a opcão não permitir exceções deve estar desmarcada
vah em exceções e adicionar porta
no nome digite qualquer coisa
e em porta : 8245
marque tcp
e ok


seu servidor jah esta funcionado agorah
qualquer duvida pergunte por e-mail

IPB Skin By Virteq