← Desenvolvimento

Banners a rodar para o lado

Lida 4071 vezes

Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Boas alguem sabe o scritp como ha no http://sondagens.tk para os banners irem rodando indo para o lado?

 :wink:
Offline

Master 
Membro
Mensagens 462 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

Não vejo banners a ir para o lado...
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Offline

Master 
Membro
Mensagens 462 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

Já vi... fui lá outra vez e agora deu...está porreiro essa cenas dos banners...
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Pois eu persisava dixo..
Offline

Nazgulled 
Membro
Mensagens 552 Gostos 0
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

Offline

frsantos 
Membro
Mensagens 1458 Gostos 0
Troféus totais: 35
Trófeus: (Ver todos)
Linux User Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter

falas com o jpgmn k ele talvex te diga, ja n o vejo por aki á uns tmps scalhar ta de ferias
Offline

MarKo 
Administrador
Mensagens 4610 Gostos 10
Feedback +1

Troféus totais: 37
Trófeus: (Ver todos)
Level 6 Windows User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter 10 Polls Poll Starter

Citação de: "x_santos"
falas com o jpgmn k ele talvex te diga, ja n o vejo por aki á uns tmps scalhar ta de ferias


Ou cansou-se do SPAM e foi-se embora, como tantos outros!  :(
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Citação de: "Nazgulled"
http://www.dyn-web.com/dhtml/pause-scr/

Vou ver obrigado
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Código: [Seleccione]
<marquee direction='left'> aqui ficam os codes dos banners </marquee>

Este deve dár...
Depois tens outros efeitos...
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Esse eu sei mas esse ta sempre a rodar nunca parra...eu keria ke tivesse intrevalos.
Parece me que o codigo dele e em asp..nimguem me arranja em java scritp ou coisa do genero?
Offline

Ricardo75 
Membro
Mensagens 1660 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Oh asturmas, foste ver o site que o Nazgulled te deu? Está lá o efeito para veres e para fazeres o download.
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Mas esse efeito e manual com o rato por cima ou ha automatico?
No pacote ke sacei n vi..
Offline

Ricardo75 
Membro
Mensagens 1660 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Offline

jpgmn 
Membro
Mensagens 305 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2 Level 1

Boas!

Ando por cá mas entre praia e descanso, apareço menos :)

asturmas já experimentaste fazer um View Source na página? :D

É puro javascript / DHTML, vai lá e vê.
Sinceramente já não me recordo onde fui buscar o original, mas a minha adaptação podes copiar na boa.

Código: [Seleccione]

<html>
<head>
<style type="text/css">
<!--
#addbox {
  position: relative;
  width: 300px;
  height: 70 px;
  clip: rect(0px, 300px, 0px, 70px);
  overflow: hidden;
}
#banner1 {
  position: relative;
  width: 270px;
  height: 60px;
  left: 0;
  top: 0px;
  cursor: pointer;
}
#banner2 {
  position: relative;
  width: 270px;
  height: 60px;
  left: 300px;
  top: -60px !important;
  top:-63px;
  cursor: pointer;
}
-->
</style>
<script>
var displayTime, speed, wait, banner1, banner2, link1, link2, bannerIndex, bannerLocations, bannerURLs;

function initVar() {
  displayTime = 7; // The amount of time each banner will be displayed in seconds.
  speed = 5; // The speed at which the banners is moved (1 - 10, anything above 5 is not recommended).
  wait = true;

  banner1 = document.getElementById("banner1");
  banner2 = document.getElementById("banner2");
  link1 = document.getElementById("link1");
  link2 = document.getElementById("link2");

  banner1 = document.getElementById("banner1");
  banner2 = document.getElementById("banner2");

  banner1.style.left = 0;
  banner2.style.left = 300;

  bannerIndex = 1;

  /* Important: In order for this script to work properly, please make sure that the banner graphic and the
  URL associated with it have the same index in both, the bannerLocations and bannerURLs arrays.
  Duplicate URLs are permitted. */

  // Enter the location of the banner graphics in the array below.
  bannerLocations = new Array(
"http://www.ptbloggers.com/Images/Promo/promofourlarge.jpg",
"http://escape.do.sapo.pt/images/sondagens.png",
"http://www.portal-jovem.com/tv/270-60.jpg",
"http://patriciacandoso.no.sapo.pt/sondagens.png",
"http://www.geocities.com/www_sondagens_tk/banner_primeirapagina.gif",
"http://www.geocities.com/www_sondagens_tk/banner_troca.gif"
);

  // Enter the URL's to which the banners will link to in the array below.
  bannerURLs = new Array(
"http://www.ptbloggers.com",
"http://forum.nofuturo.com",
"http://www.portal-jovem.com/tv",
"http://www.patriciacandoso.pt.vu",
"http://www.primeira-pagina.com",
"mailto:www.sondagens.tk@gmail.com"
);
}

function moveBanner(){
  stopped = false;
  if(!wait){
    banner1.style.left = parseInt(banner1.style.left) -  (speed * 5);
    banner2.style.left = parseInt(banner2.style.left) - (speed * 5);
    if(parseInt(banner1.style.left) <= -300){
      banner1.style.left = 300;
      bannerIndex = (bannerIndex < (bannerLocations.length - 1)) ? ++bannerIndex :0;
      banner1.src = bannerLocations[bannerIndex];
      wait = true;
    }
    if(parseInt(banner2.style.left) <= -300){
      banner2.style.left = 300;
      bannerIndex = (bannerIndex < (bannerLocations.length - 1)) ? ++bannerIndex :0;
      banner2.src = bannerLocations[bannerIndex];
      wait = true;
    }

    setTimeout("moveBanner()",100);
  } else {
      wait = false;
 stopped = true;
      setTimeout("moveBanner()", displayTime * 1000);
  }
}

function gosite()
{
var ind;

if (bannerIndex > 0)
{
ind = bannerIndex - 1;
}
else
{
ind = bannerLocations.length - 1;
}

if (stopped)
{
if (bannerURLs[ind].substring(0,7) == "mailto:")
{
window.location.href = bannerURLs[ind];
}
else
{
window.open(bannerURLs[ind]);
}
}
}
</script>
</head>
<body onLoad="initVar(); moveBanner()">
<center>

<div name="addbox" id="addbox">
<span name="link1" id="link1" style="cursor:pointer" onclick="gosite();"><img border="0" name="banner1" id="banner1" src="http://www.ptbloggers.com/Images/Promo/promofourlarge.jpg"></span>
<span name="link2" id="link2" style="cursor:pointer" onclick="gosite();"><img border="0" name="banner2" id="banner2" src="http://escape.do.sapo.pt/images/sondagens.png"></span>
</div>

</center>
</body>
</html>


Abraços,