Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Estou usando um código para uma troca de estilos, onde tenho o fundo normal com fonte preta e o outro fundo preto com fonte branca. porém quando mando trocar o fundo fica preto mas a fonte não fica branca. Testei o script fora do site e ele funciona normal, dentro do site acontece o que falei...já tentei de tudo e nada de dar certo, ão consigo imaginar o que pode ser..
Alguem pode me dar uma ajuda?
vou colocar o código de 3 páginas aqui: index.php, botacessibilidade.php (barra onde tem os botões que troco de estilo), mostra-noticia.php (pagina onde quero alterar o fundo da noticia)
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<? include ("headers.php"); ?>
<style type="text/css"> margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-repeat:no-repeat;
background-position:center 0px;
background-image: url(imagens/fundotopo.jpg);
background-color: #F4F5F3;
}</style>
<script type="text/javascript" src="flash.js"></SCRIPT>
<link rel="stylesheet" type="text/css" href="style.css" title="styles1" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="teste2.css" title="preto" media="screen" />
<script type="text/javascript" src="js/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="styleswitch.js"></script>
<script language="JavaScript">
var tgs = new Array( 'div','td','tr','a');
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var startSz = 2;
function ts( trgt,inc ) {
if (!document.getElementById) return
var d = document,cEl = null,sz = startSz,i,j,cTags;
sz += inc;
if ( sz < 0 ) sz = 0;
if ( sz > 6 ) sz = 6;
startSz = sz;
if ( !( cEl = d.getElementById( trgt ) ) )
cEl = d.getElementsByTagName( trgt )[ 0 ];
cEl.style.fontSize = szs[ sz ];
for ( i = 0 ; i < tgs.length ; i++ ) {
cTags = cEl.getElementsByTagName( tgs[ i ] );
for ( j = 0 ; j < cTags.length ; j++ )
cTags[ j ].style.fontSize = szs[ sz ];
}
}
</script>
<script languaje="JavaScript" type="text/javascript">
function addBookmark(){
bookmarkurl='http://www.associtrus.com.br/'
bookmarktlt='Associação Brasileira de Citricultores - ASSOCITRUS'
if(document.all){
window.external.addFavorite(bookmarkurl,bookmarktlt)
}
}
function abriFIX() {
document.getElementById('fex').style.display="";
}
function fecharFIX() {
document.getElementById("fex").style.display="none";
}
</script>
<script type="text/javascript">
function valida(){
var email = document.getElementById('xemail');
if ((email.value.length != "") && ((email.value.indexOf("@") < 1) || (email.value.indexOf('.') < 7)))
{
alert('Digite um E-mail válido');
email.focus();
return false;
}
if(email.value == ""){
alert("Digite seu E-mail!");
email.focus();
return false;
}
return true;
}
</script>
<title>Associtrus - Associação Brasileira de Citricultores</title></head>
<body>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="159" valign="top"><? include("topo.php"); ?></td>
</tr>
</table>
<?php if(!$xvar){ ?>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="10" valign="top"><img src="imagens/branco10.gif" width="10" height="10" /></td>
<td width="806" valign="top"><table width="806" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="220" valign="top"><table width="220" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><? include("menu.php"); ?></td>
</tr>
<tr></tr>
</table></td>
<td width="586" valign="top">
<?
if(!$xvar){
include ("meio.php");
}
?></td>
</tr>
</table>
<table width="806" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><? include("quadros.php"); ?></td>
</tr>
</table>
</td>
<td width="177" valign="top"><table width="177" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><? include("publicidade.php"); ?></td>
</tr>
</table>
</td>
<td width="10" valign="top"><img src="imagens/branco10.gif" width="10" height="10" /></td>
</tr>
</table>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><? include("baixo.php"); ?></td>
</tr>
</table>
<?php } else { ?>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="10" valign="top"><img src="imagens/branco10.gif" width="10" height="10" /></td>
<td width="220" valign="top">
<table width="220" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><? include("menu.php"); ?></td>
</tr>
<tr></tr>
</table>
</td>
<td width="586" valign="top">
<?
if($xvar){
if(file_exists($xvar.".php")){
include($xvar.".php");
} else {
include ("meio.php");
}
}
?></td>
<td width="177" valign="top">
<table width="177" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><? include("publicidade.php"); ?></td>
</tr>
</table>
</td>
<td width="10" valign="top"><img src="imagens/branco10.gif" width="10" height="10" /></td>
</tr>
</table>
<?php } ?>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30"> </td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td style="background-repeat:no-repeat; background-position:center 0px; "background="imagens/fundorodape.jpg"><table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="95" valign="top"><? include("rodape.php"); ?></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
botacessibilidade.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css"> margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}</style>
</head>
<body>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0" id="bots">
<!-- fwtable fwsrc="acessibilidade.png" fwpage="Page 1" fwbase="acessibilidade.jpg" fwstyle="Dreamweaver" fwdocid = "1340998746" fwnested="1" -->
<tr>
<td><img name="acessibilidade1" src="imagens/acessibilidade1.jpg" width="400" height="15" border="0" id="acessibilidade1" alt="" /></td>
</tr>
<tr>
<td><table align="left" border="0" cellpadding="0" cellspacing="0" width="400">
<tr>
<td><img name="acessibilidade2" src="imagens/acessibilidade2.jpg" width="6" height="25" border="0" id="acessibilidade2" alt="" /></td>
<?php
$id = $_GET['id'];
$xvar = $_GET['xvar'];
$idtipo = $_GET['idtipo'];
?>
<td><a href="#" onclick="window.open('enviar_email.php?id=<?php echo $id ?>&pg=<?php echo $xvar?>&idtipo=<?php echo $idtipo?>', 'popup', 'width=180,height=280');">
<img name="boterros" src="imagens/boterros.jpg" width="68" height="25" border="0" id="boterros" alt="" /></a></td>
<td><img name="acessibilidade3" src="imagens/acessibilidade3.jpg" width="16" height="25" border="0" id="acessibilidade3" alt="" /></td>
<td><a href="imprime-noticia.php?id=<? echo $id ?>" target="_blank">
<img name="botimpressao" src="imagens/botimpressao.jpg" width="77" height="25" border="0" id="botimpressao" alt="" /></a></td>
<td><img name="acessibilidade4" src="imagens/acessibilidade4.jpg" width="16" height="25" border="0" id="acessibilidade4" alt="" /></td>
<td><a href="serversideSwitch.html?style=teste2" rel="preto" class="styleswitch">
<img name="botescuro" src="imagens/botescuro.jpg" width="16" height="25" border="0" id="botescuro" alt="" /></a></td>
<td><img name="acessibilidade5" src="imagens/acessibilidade5.jpg" width="5" height="25" border="0" id="acessibilidade5" alt="" /></td>
<td><a href="serversideSwitch.html?style=style" rel="styles1" class="styleswitch">
<img name="botclaro" src="imagens/botclaro.jpg" width="16" height="25" border="0" id="botclaro" alt="" /></a></td>
<td><img name="acessibilidade9" src="imagens/acessibilidade9.jpg" width="38" height="25" border="0" id="acessibilidade9" alt="" /></td>
<td><img name="acessibilidade6" src="imagens/acessibilidade6.jpg" width="16" height="25" border="0" id="acessibilidade6" alt="" /></td>
<td><a href="javascript:ts('letras',1)">
<img name="botamais" src="imagens/botamais.jpg" width="22" height="25" border="0" id="botamais" alt="" /></a></td>
<td><img name="acessibilidade7" src="imagens/acessibilidade7.jpg" width="5" height="25" border="0" id="acessibilidade7" alt="" /></td>
<td><a href="javascript:ts('letras',-1)">
<img name="botamenos" src="imagens/botamenos.jpg" width="22" height="25" border="0" id="botamenos" alt="" /></a></td>
<td><img name="acessibilidade10" src="imagens/acessibilidade10.jpg" width="55" height="25" border="0" id="acessibilidade10" alt="" /></td>
<td><img name="acessibilidade8" src="imagens/acessibilidade8.jpg" width="22" height="25" border="0" id="acessibilidade8" alt="" /></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
mostra-noticia.php
<link rel="stylesheet" type="text/css" href="style.css" title="styles1" media="screen" />
<script src="js/jquery.validate.js" type="text/javascript"></script>
<script src="js/cmxforms.js" type="text/javascript"></script>
<script type="text/javascript">
$().ready(function() {
$("#formulario").validate({
rules: {
nome: {
required: true
},
email: {
required: true
},
nomeamigo: {
required: true
},
emailamigo: {
required: true
}
},
messages: {
nome: {
required: " <span class=erro>Por favor, digite seu Nome </span>"
},
email: {
required: " <span class=erro>Por favor, digite seu E-mail </span>"
},
nomeamigo: {
required: " <span class=erro>Por favor, digite o Nome do destinatário </span>"
},
emailamigo: {
required: " <span class=erro>Por favor, digite o E-mail do destinatário </span>"
}
}
});
});
</script>
<table width="586" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="44"><span class="titlaranja">
<?php if($idtipo == 1){?>editorial<?php } ?>
<?php if($idtipo == 2){?>Saúde<?php } ?>
<?php if($idtipo == 3){?>cooperativismo<?php } ?>
<?php if($idtipo == 4){?>seção técnica<?php } ?>
<?php if($idtipo == 5){?>receitas<?php } ?>
</span>
<span class="mais2">+</span></td>
</tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php include ("botacessibilidade.php"); ?>
<br />
<br />
<div class="paginas" id="letras">
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0" >
<?php
include("db.php");
$id = (int)$_GET['id'];
$idtipo = (int)$_GET['idtipo'];
$sql = mysqli_query($conn,"SELECT * FROM noticias WHERE id = '".$id."' LIMIT 1");
while($row = mysqli_fetch_assoc($sql)){
$titulo = $row['titulo'];
$texto = $row['noticia'];
$texto2 = preg_replace('/<(.*)style=".*"( ?)(.*)>/','<$1,$3>',$texto);
?>
<tr>
<td height="20" class="titlaranja2"><strong><?php echo $row['titulo'] ?></strong>
<br />
<br />
</td>
</tr>
<tr>
<td height="20"><?php echo $texto2 ?></td>
</tr>
<?php
$url = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
}
?>
</table>
</div>
</td>
</tr>
</table>
<br />
<table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="textonormal"><a href="javascript:history.back()"><span class="textonormal"><strong><<Voltar</strong></span></a></td>
</tr>
</table>
<br />
<br />
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<form action="indica-noticia.php" method="post" id="formulario">
<table width="550" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td colspan="2" class="textonormal"><strong>Indique esta notícia</strong></td>
</tr>
<tr>
<td width="77" class="textonormal">Seu nome:</td>
<td width="466" class="textonormal"><input name="nome" type="text" id="nome" size="30" /></td>
</tr>
<tr>
<td class="textonormal">Seu e-mail:</td>
<td class="textonormal"><input name="email" type="text" id="email" size="30" /></td>
</tr>
<tr>
<td class="textonormal">Nome Amigo:</td>
<td class="textonormal"><input name="nomeamigo" type="text" id="nomeamigo" size="30" /></td>
</tr>
<tr>
<td class="textonormal">E-mail Amigo:</td>
<td class="textonormal"><input name="emailamigo" type="text" id="emailamigo" size="30" /></td>
</tr>
<tr>
<td class="textonormal"> </td>
<td class="textonormal">
<input type="hidden" name="xacao" value="enviar" />
<input type="hidden" name="urlnoticia" value="<?php echo $url ?>" />
<input type="hidden" name="titulo" value="<?php echo $titulo?>" />
<input type="submit" name="button" id="button" value="Enviar" /> </td>
</tr>
</table>
</form> </td>
</tr>
</table>Carregando comentários...