Ir para conteúdo

POWERED BY:

Arquivado

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

adcortes

chamando div de outra pagina

Recommended Posts

Ola,

estou com uma duvida..

tenho uma pagina que contem 5 show/hide divs.

cada uma delas tem uma id.

 

essa pagina de divs será chamada atraves de uma anterior que terá 5 links..

cada link desse deve levar para a mesma pagina (no caso essa com as divs hide/show), porem clicando no link 1 a div1 da outra pagina aparecera aberta.. clicando no link 2 a div2 da outra pagina aparecerá aberta,

ou seja.. a pagina com as divs em show/hide aparecerá com uma das divs abertas (show) jah. e isso irá depender do clique que foi feito na pagina com os links..

 

espero q tenha conseguido passar a ideia.

 

alguem poderia me ajudar?

 

meu script esta assim:

 

<script>	var divAtual=1;	var popAtual;	function showHide(id){		if(divAtual==id) {			if(document.getElementById("div"+divAtual).style.display=="none"){				document.getElementById("div"+divAtual).style.display= "";			}else{				document.getElementById("div"+divAtual).style.display= "none";			}			}else{			if(divAtual) document.getElementById("div"+divAtual).style.display="none";				document.getElementById("div"+id).style.display="";				divAtual=id;			}		}	</script>		<script>		function showPop(id){			document.getElementById("alertPop"+id).style.display="";			var h = getPageSize()[1];			document.getElementById("alphaLayer").style.height = h+"px";			document.getElementById("alphaLayer").style.display="";			popAtual=id;		}		function hidePop(){			document.getElementById('alertPop'+popAtual).style.display="none";			document.getElementById("alphaLayer").style.display="none";		}		function getPageSize(){			var xScroll, yScroll;			if (window.innerHeight && window.scrollMaxY) {				xScroll = window.innerWidth + window.scrollMaxX;				yScroll = window.innerHeight + window.scrollMaxY;			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac				xScroll = document.body.scrollWidth;				yScroll = document.body.scrollHeight;			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari				xScroll = document.body.offsetWidth;				yScroll = document.body.offsetHeight;			}			var windowWidth, windowHeight;		//	console.log(self.innerWidth);		//	console.log(document.documentElement.clientWidth);			if (self.innerHeight) {	// all except Explorer				if(document.documentElement.clientWidth){					windowWidth = document.documentElement.clientWidth;				} else {					windowWidth = self.innerWidth;				}				windowHeight = self.innerHeight;			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode				windowWidth = document.documentElement.clientWidth;				windowHeight = document.documentElement.clientHeight;			} else if (document.body) { // other Explorers				windowWidth = document.body.clientWidth;				windowHeight = document.body.clientHeight;			}			// for small pages with total height less then height of the viewport			if(yScroll < windowHeight){				pageHeight = windowHeight;			} else {				pageHeight = yScroll;			}		//	console.log("xScroll " + xScroll)		//	console.log("windowWidth " + windowWidth)			// for small pages with total width less then width of the viewport			if(xScroll < windowWidth){				pageWidth = xScroll;			} else {				pageWidth = windowWidth;			}		//	console.log("pageWidth " + pageWidth)			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)			return arrayPageSize;		}	</script>

e eu chamo asism no html

 

<div onclick="showHide(1);"><div onclick="showHide(2);">etc

obrigado.

Adriana

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.