Jump to content
Fórum Script Brasil
  • 0

BANNER ROTATIO - HELP


Evandro Diego Erlo

Question

Bom Dia..

banner.jpg

Desenvolvi este banner ele possue os botoes de avancar e recuar funcionando perfeitamente, mas preciso agora que ele seja rotativo a cada certo tempo , podem me ajudar?

Segue Código:

<div id="solucoes">
            <?
include "solucoesbanner/config.php";

$numero = 1;            
  $sql = mysql_query("SELECT * FROM solucoes");
          while($linha = mysql_fetch_array($sql)){
              $id = $linha['id'];
            $foto = $linha['foto'];
            $descricao = $linha ['descicao'];
            $conta++;
                      
 ?>
 <script language="JavaScript"><!--script para avancar-->
var contador = 0;
function conta() {
    if(contador == 0) {
       
            function Mostra<? echo $conta ?>(){
    document.getElementById('img<? echo $conta ?>').style.display='block';
}
function Esconde<? echo $conta ?>(){
    document.getElementById('img<? echo $conta ?>').style.display='none';
}

        contador = 11;
    }
    contador = contador-1;
    setTimeout("conta()", 1000);
}
</script><!--Fim script para avancar-->
<script language="javascript">
function Mostra<? echo $conta ?>(){
    document.getElementById('img<? echo $conta ?>').style.display='block';
}
function Esconde<? echo $conta ?>(){
    document.getElementById('img<? echo $conta ?>').style.display='none';
}

</script>
<?
          }
?>
<?
$contad++;
$sql = mysql_query("SELECT * FROM solucoes");
          while($linha = mysql_fetch_array($sql)){
              $id = $linha['id'];
            $foto = $linha['foto'];
            $descricao = $linha ['descicao'];
            $titulo = $linha ['titulo'];
            $link = $linha ['link'];
            $numero++;
            
        if ($contad == 1){
        $display = "block";
        }
        if ($contad != 1){
        $display = "none";
        }

?>
<div id="img<? echo $contad ?>" style="width:327px; height:340px; background-image:url(solucoesbanner/<? echo $foto ?>); display:<? echo $display ?>; background-repeat:no-repeat; background-position:top;"><img src="solucoesbanner/LagoAzul.png" width="327" height="224" border="0" /><?
$atual = $contad;
$atual--;

?>
<div id="setadireita" style="position:absolute; top:160px; width:33px; height:34px; left: 260px;"><a href="java script:Mostra<? echo $numero ?>();java script:Esconde<? echo $contad ?>()"><img src="solucoesbanner/setadireitra.png" width="33" height="34" border="0" /></a>
</div>
<div id="setaesquerda" style="position:absolute; width:25px; height:26px; left: 238px; top: 170px;"><a href="java script:Mostra<? echo $atual ?>();java script:Esconde<? echo $contad ?>()"><img src="solucoesbanner/setaesquerda.png" width="25" height="26" border="0" /></a>
</div>
<br />
<div id="titulosolu" style="float:left; clear:both; width:260px; margin-left:20px;"><img src="LagoAzul.jpg" width="9" height="11"><span style="color:#124ea2; font-family:Verdana, Geneva, sans-serif; font-size:10px;"><?
echo $titulo;

?></span><br>

<br />
<span style="color:#707070; font-family:Verdana, Geneva, sans-serif;"><?
echo $descricao;
?></span></div>
<div id="links" style="position:absolute; left: 260px; top: 325px;"><a href="<? echo $link ?>"><img src="saiba.jpg" width="60" height="18" border="0"></a></div>
</div>
<?
$contad++;
 }
?>
</div>

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...