Ir para conteúdo
Fórum Script Brasil
  • 0

Script do Sistema de poup-up


jow

Pergunta

noticias.asp

<html>
<head>
<title>Noticias - News</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style rel="stylesheet" type="text/css">
/*<![CDATA[*/
a:link {text-decoration: none;}
a:visited {text-decoration: none; color:#FFFF00;}
a:hover {text-decoration: none;color: red}
a:active {text-decoration: none;}

#caixa{
background:#ff0000; /* cor de fundo */
width:400px; /* tamanho da faixa */
height:50px;
overflow:hidden;
}
#marquee{
width:400px;

background; /* cor da primeira noticia */ 
}
/*]]>*/
</style>
<script type="text/javascript">

/* INICIO POUPUP */

/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit [url=http://dynamicdrive.com]http://dynamicdrive.com[/url]
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

/* FIM DO POUPUP */



//<![CDATA[
var Rollar = "sim";/*Não Altere faz parte do EFEITO*/
var tipo = "left";/*Altere para usar as opções LEFT, RIGHT, TOP e DOWN*/
var roll = 0;/*Não Altere faz parte do EFEITO*/
var tmp = 29;/*Defina a velocidade aqui*/

function Duplicar(){
    var Marquee = document.getElementById("Marquee");
    Cont = Marquee.innerHTML;
    if (tipo=="left" || tipo=="right"){
        IDA = "<div style=\"float:left; position:relative;margin-left:-"+Marquee.clientWidth+";width:"+Marquee.clientWidth+"; height:"+Marquee.clientHeight+";\">"+Cont+"</div>";
        IDB = "<div style=\"float:right; position:relative;margin-right:-"+Marquee.clientWidth+";width:"+Marquee.clientWidth+"; height:"+Marquee.clientHeight+";\">"+Cont+"</div>";
        IDC = IDA + IDB + Cont;
    }
    if(tipo=="top" || tipo=="down"){
        IDA = "<div style=\"float:left; position:relative;margin-top:-"+Marquee.clientHeight+";width:"+Marquee.clientWidth+"; height:"+Marquee.clientHeight+";\">"+Cont+"</div>";
        IDB = "<div style=\"float:left; position:relative;margin-bottom:-"+Marquee.clientHeight+";width:"+Marquee.clientWidth+"; height:"+Marquee.clientHeight+";\">"+Cont+"</div>";
        IDC = IDA + Cont + IDB;
    }
    Marquee.innerHTML = IDC;
}
function Fmarquee(){
    var Marquee = document.getElementById("Marquee");
    var Caixa = document.getElementById("caixa");

if(tipo=="left" || tipo=="right"){
    var Altura = Caixa.clientWidth;
}else if(tipo=="down" || tipo=="top"){
    var Altura = Caixa.clientHeight;
}

    roll++;

    if(Altura==roll){
        roll = (roll*-1);
    }

    if(tipo == "top"){
        Marquee.style.marginTop = (roll*-1)+"px";
    } else if (tipo == "down"){
        Marquee.style.marginTop = roll+"px";
    } else if (tipo == "left"){
        Marquee.style.marginLeft = (roll*-1)+"px";
    } else if (tipo == "right"){
        Marquee.style.marginLeft = roll+"px";
    }

    if(Rollar == "sim"){
       setTimeout("Fmarquee()",tmp);
    }
}
function playM(){
    Rollar = "sim";
    Fmarquee();
}

function stopM(){
    Rollar = "não";
}

window.onload = function(){
    Rollar = "sim";
    Fmarquee();
    Duplicar();
}
//]]>
</script>

</head>
<body>
  <div id="caixa" onMouseOut="playM();" onMouseOver="stopM();">
    <div id="Marquee">
    <!-- #include file="admin/config/conexao.asp"-->
        <%
    call abre_conectar

nome=request.Form("nome")
titulo=request.Form("titulo")
noticia=request.Form("noticia")
autor=request.Form("autor")
autonum = Request.QueryString("autonum")

sql = "Select * from contato "  

set tab = cnn.execute(sql) %>

    <% while not tab.EOF %>
    <br>
    
    <table>
<tr> 

<%
n = 1
c = 5
'c, é aqui que você controla o numero de colunas
Do while not tab.Eof
%>
<td><center><font size="2px"><b><a href="detalhe_noticia.asp?noticia=<%=tab("autonum")%>"onClick=                "NewWindow(this.href,'name','200','300','yes');return false"><%=tab("titulo")%>|</a></font></center></td>
<%
n = n + 1
tab.Movenext
If n > c then
response.write "</tr><tr>"
n = 1
End If
Loop
%>
</table>
    
    <% 
    wend %>
    
<% call fecha_conectar 
set tab = nothing %>
      </div>
  </div>
</body>
</html>
detalhe_noticia.asp
<!-- #include file="admin/config/conexao.asp"-->

<%

call abre_conectar

autonum1 = Request.QueryString("noticia")

sql = "Select * from contato WHERE autonum = "&autonum1
set tab = cnn.execute(sql) %>

<body bgcolor="red" text="white">
<table width="100%" border="0">
  <tr>
        
    <% while not tab.EOF %>
    <td><left><b><%=tab("titulo")%></td>
    <tr>
    <td><br><letf><%=tab("noticia")%></td></tr>
    <tr> 
    <td><br><letf><b><i><%=tab("autor")%></td></tr><% tab.movenext 
    wend %>
    
    </table>
</body>
<% call fecha_conectar 
set tab = nothing %>

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152k
    • Posts
      651,8k
×
×
  • Criar Novo...