Jump to content
Fórum Script Brasil
  • 0

Script do Sistema de poup-up


jow

Question

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 to post
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
      148691
    • Total Posts
      644524
×
×
  • Create New...