Jump to content


Photo

Layer Cobrindo Toda A Página


  • Faça o login para participar
12 replies to this topic

#1 knoxville

knoxville

    Backdoor Man

  • Usuários
  • 951 posts
  • Sexo:Masculino
  • Localidade:Itajaí - SC

Posted 06/08/2008, 21:49

fala pessoal, td tranquilo?
estou desenvolvendo um projeto no qual gostaria de fazer um sistema de mostrar/esconder uma layer que cubra a página inteira, como o de login do fotolog (imagem anexo)
gostaria que essa layer aparecesse/desaparecesse esmaecendo
alguem me ajuda a fazer?
muito obrigado! (y)

Attached Files


Edição feita por: knoxville, 06/08/2008, 21:50.


#2 knoxville

knoxville

    Backdoor Man

  • Usuários
  • 951 posts
  • Sexo:Masculino
  • Localidade:Itajaí - SC

Posted 09/08/2008, 18:52

pesquisando, consegui algumas coisas...
<html>
<head>
<style>
html { height:100%; }
body { height:100%; margin:0px; padding:0px; }
div { height:100%; -moz-opacity: .5; }
</style>
<script>
function div(div) {
var objeto = document.getElementById(""+div+"");
if(objeto.style.display == 'none') {
objeto.style.display = 'block';
} else {
objeto.style.display = 'none';
}
}
</script>
</head>
<body>
<a href="#" onClick="java script:div('div');"><img src="11720756047679350376.jpeg" border="0"></a>
<div id="preco" style="position:absolute; left: 200px; top: 200px; z-index:1">
<font face="verdana" size="6" color="#000000"><b>teste</b></font></div>
<div id="div1" style="position:absolute; width:100%; left:0px; z-index:2; top: 0px; background:URL(fundo.gif); display: none">
<center><a href="#" onClick="java script:div('div');">FECHAR</a></center>
</div>
</body>
</html>
tô com 2 problemas:
1) como faço pra aplicar um style só em UM div, e nao em todos?
2) como faço pra quando mostrar o div, a parte que ficou no fundo, ficar meio esmaecida?

muito obrigado! (y)

#3 fekz

fekz

    12 Horas

  • Usuários
  • 243 posts
  • Sexo:Não informado

Posted 09/08/2008, 21:10

Para aplicar a um div só bote:
<div id="nome">

e no css

#nome {
atributo: propriedade;
}

#4 knoxville

knoxville

    Backdoor Man

  • Usuários
  • 951 posts
  • Sexo:Masculino
  • Localidade:Itajaí - SC

Posted 11/08/2008, 17:30

Para aplicar a um div só bote:
<div id="nome">

e no css

#nome {
atributo: propriedade;
}

tinha testado isso mas tinha esquecido de mudar o nome q ele usa na hora de mostrar/esconder o div, ai nao tava funcionando... descuido meu.
vlw fekz!

o -moz-opacity: .5 não serviu pra esmaecer o fundo como eu queria, alguem me ajuda com esta parte?
obrigado!

#5 bimonti

bimonti

    Super Veterano

  • Usuários
  • 2654 posts
  • Sexo:Masculino

Posted 12/08/2008, 13:27

É opacity:

.classe{
  opacity:0.5;
}

Pro IE tem que usar filter.
WebFórum - Equipe de Desenvolvimento - Monitor
Posted Image
Yeah I do have some stories, and it's true I want all the glory ...

#6 knoxville

knoxville

    Backdoor Man

  • Usuários
  • 951 posts
  • Sexo:Masculino
  • Localidade:Itajaí - SC

Posted 15/08/2008, 00:11

com as dicas de vocês e mais umas pesquisas consegui exatamente o que eu queria... :D

<html>
<head>
<style>
html { height:100%; }
body { height:100%; margin:0px; padding:0px; }
#nome { height:100%; }
.classe { filter: alpha(opacity=40); opacity: .4; }
</style>
<script>
function div(div) {
var objeto = document.getElementById(""+div+"");
if(objeto.style.display == 'none') {
objeto.style.display = 'block';
document.getElementById('teste').className = 'classe';
} else {
objeto.style.display = 'none';
document.getElementById('teste').className = '';
}
}
</script>
</head>
<body>

<div id="teste" class="">
<a href="#" onClick="java script:div('nome');"><img src="11720756047679350376.jpeg" 

border="0"></a>
<div id="preco" style="position:absolute; left: 200px; top: 200px; z-index:1">
<font face="verdana" size="6" color="#000000"><b>2,27</b></font></div>
</div>

<div id="nome" class="" style="position:absolute; width:100%; left:0px; z-index:2; top: 

0px; background:URL(fundo.gif); display: none">
<center><a href="#" onClick="java script:div('nome');">FECHAR</a></center>
</div>

</body>
</html>

obrigado fekz e bimonti!

:(

problemas... quando tem barra de rolagem, o 100% do tamanho da div superior, só cobre a parte que estava vendo, descendo a barra de rolagem, o resto fica sem a imagem de fundo!
alguma dica? idéia?
vlw! (y)

Edição feita por: knoxville, 14/08/2008, 15:53.


#7 bimonti

bimonti

    Super Veterano

  • Usuários
  • 2654 posts
  • Sexo:Masculino

Posted 15/08/2008, 10:27

Com css é o máximo que você vai conseguir fazer. Tem que usar javascript.

overlay = {
	
	add : function(){
		var c = overlay.getSize();
		var o = document.createElement("div");
			o.setAttribute("id", "overlay");
	
		document.body.appendChild(o);
	
		var el = document.getElementsByTagName('select');
		for(x=0,y=el.length;x<y;x++){
			_s(el[x],'visibility','hidden');
		}
	
		var el = $('overlay');
			el.className = "overlay";
			el.style.height = c.b+'px';	
	},
	
	remove : function(){
		document.body.removeChild($('overlay'));
		var el = document.getElementsByTagName('select');
		for(x=0,y=el.length;x<y;x++){
			_s(el[x],'visibility','visible');
		}
	},
	
	getSize : function(){
		var w = document.body.clientWidth || innerWidth;
		var h = document.body.clientHeight || innerHeight;
		var a = window.scrollMaxX || 0;
		var b = window.scrollMaxY || 0;
		return {a:w,b:h+b}
	}	
}

Eu fiz essa classe pra usar em um site. Não é difícil implementar, mas eu estou sem tempo agora. Tente fazer ae, qq coisa poste se tiver dúvidas. Você chama a classe assim overlay.add(); ... e precisa criar uma classe chamada overlay com a transparência que você quiser.

PS: Precisa dessas 2 funções tbm:
/* $();
 * Return a reference to the element
 * Usage: var el = $('id');
 */
function $(w){
		return document.getElementById(w);
}
/* _s();
 * Change the inline style of an element
 * Usage: _s($('id'),'color','#f00');
 */
function _s(obj,p,v){
	obj.style[p] = v;
}

WebFórum - Equipe de Desenvolvimento - Monitor
Posted Image
Yeah I do have some stories, and it's true I want all the glory ...

#8 knoxville

knoxville

    Backdoor Man

  • Usuários
  • 951 posts
  • Sexo:Masculino
  • Localidade:Itajaí - SC

Posted 26/08/2008, 19:48

(1 ano depois... hehe)
bimonti, não consegui "juntar" esse code ai com o meu, será q pode me ajudar?
mto obrigado!

#9 knoxville

knoxville

    Backdoor Man

  • Usuários
  • 951 posts
  • Sexo:Masculino
  • Localidade:Itajaí - SC

Posted 03/10/2008, 10:36

*
no firefox ele fica opaco como eu quero que seja, porém não cobre toda a página caso tenha barra de rolagem
no ie, cobre toda a página independente das barras de rolagem, porém fica totalmente transparente, não fica opaco!

alguém ajuda por favor???

MUITO OBRIGADO!

#10 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 17/09/2017, 08:57

Vente Lioresal En Canada cialis Levitra For Sale On Ebay
How To Write Out Trazodone Prescription Propecia Recuperarpelo
Order Now On Line Isotretinoin Medicine Fedex Shipping <a href=http://cialtobuy.com>online pharmacy</a> Viagra Zollprobleme
Acquisto Viagra E Cialis online pharmacy Priligy Ficha Tecnica
Tamoxifen Online Canada Walmart Cialis Prices Without Insurance Order Kamagra India
Chewable Viagra <a href=http://cialtobuy.com>buy cialis</a> Cheap Generic Bentyl Need In Internet
Lioresal Posologie cialis buy online Progynova
Tadalafil Tablets 20mg
Comprar Cialis Soft Tabs <a href=http://cialtobuy.com>cheap cialis</a> Sale Isotretinoin Roacutan Website Cheapeast

#11 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 27/09/2017, 03:39

Finasteride Cheap Secure Hydrochlorothiazide Priligy Mode D Emploi cialis Zzpills Macrobid Direct Medicine Free Shipping No Physician Approval
Levitra Nitric Oxide Cialis Italia Farmacia buy cialis Trazodone
Kamagra Soft Pharmacy24online Hydrochlorothiazide Express Delivery Store generic cialis Cialis Tadalafil Pas Cher Comprare Cialis
Acticin Discount Without Perscription Overseas Cialis Oglasi Acheter Cialis Non Generique cialis online Generic Zithromax Tablet Buy Xenical Au Astrazeneca Nexium Discount Card
Bentyl 20mg Byclomine Muscle Spasms cialis Trusted Onlone Pharmacy

#12 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 31/10/2017, 18:09

Farmacia Online Cialis Generico Online Pharmacy 47 get online levitra prescription Cialis Online Us
Clomid Arterielle india 4 pharmacy levitra cheap Nombres Women Argentina Zentel Helmidazole No Doctors Consult Priligy Ventes
Buy Nexium From India Cheap Sex Pills Drug Like Viagra But No Prescription viagra Buy Gabapentin Online Kamagra Prescription

#13 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 29/11/2017, 06:28

Cialis Commande Rapide Cialis Tadalafil 20mg Wirkung Reputable Online Pharmacy Usa viagra Buy Fluoxetine Uk Clomid Multiple Cialis Generico Ricetta
Cialis Generico E Legale cheapest generic levitra Omeprazole Clarithromycin Amoxicillin




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq