Jump to content


Photo

Banner auto close? Ajudem

javascript java html xhtml script

  • Faça o login para participar
3 replies to this topic

#1 lehmartins

lehmartins

    Novato no fórum

  • Usuários
  • 2 posts
  • Sexo:Masculino
  • Localidade:Lins

Posted 25/02/2015, 16:41

Olá boa tarde pessoal, estou fazendo um site empresarial, porém não sou formado em web, e não tenho um conhecimento mestre igual ao de vocês, porém estou indo pouco a pouco. (PS: O site é pra minha empresa).

 

Pois bem, adicionei uma função com um código pronto, que cria uma janela de banner/propaganda na página consegui incorporá-la sem maiores problemas, mas ai é que está. Eu gostaria que ela fechasse sozinha com determinado tempo, ao invés de precisar clicar lá no "X".

 

o código é:

 

no body...

<body onload="MM_timelinePlay('Timeline1')">
<div id="apDiv1" style="left: 10px; top: 15px;"><img src="images/banner.png" width="476" height="355" border="0" usemap="#Map" longdesc="images/banner2.png" />
<map name="Map" id="Map">
  <area shape="rect" coords="437,1,475,35" href="#" onclick="MM_showHideLayers('apDiv1','','hide')" />
<area shape="rect" coords="397,296,699,516" href="http://www.sdlins.com.br/" target="_eu" alt="Solução Digital - Lins"  />
</map></div>

no head...

<!--
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_timelinePlay(tmLnName, myID) { //v1.2
  //Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
  if (myID == tmLn.ID) { //if Im newest
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j]; 
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

function MM_initTimelines() { //v4.0
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    var ns4 = (ns && parseInt(navigator.appVersion) == 4);
    var ns5 = (ns && parseInt(navigator.appVersion) > 4);
    var macIE5 = (navigator.platform ? (navigator.platform == "MacPPC") : false) && (navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4);
    document.MM_Time = new Array(1);
    document.MM_Time[0] = new Array(1);
    document.MM_Time["Timeline1"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline1";
    document.MM_Time[0].fps = 15;
    document.MM_Time[0][0] = new String("sprite");
    document.MM_Time[0][0].slot = 1;
    if (ns4)
        document.MM_Time[0][0].obj = document["apDiv1"];
    else if (ns5)
        document.MM_Time[0][0].obj = document.getElementById("apDiv1");
    else
        document.MM_Time[0][0].obj = document.all ? document.all["apDiv1"] : null;
    document.MM_Time[0][0].keyFrames = new Array(1, 5, 12, 18, 26, 30);
    document.MM_Time[0][0].values = new Array(2);
    if (ns5 || macIE5)
        document.MM_Time[0][0].values[0] = new Array("10px", "13px", "16px", "19px", "25px", "30px", "36px", "42px", "49px", "56px", "62px", "68px", "72px", "75px", "77px", "78px", "81px", "86px", "92px", "98px", "104px", "111px", "118px", "124px", "130px", "135px", "139px", "138px", "136px", "135px");
    else
        document.MM_Time[0][0].values[0] = new Array(10,13,16,19,25,30,36,42,49,56,62,68,72,75,77,78,81,86,92,98,104,111,118,124,130,135,139,138,136,135);
    document.MM_Time[0][0].values[0].prop = "left";
    if (ns5 || macIE5)
        document.MM_Time[0][0].values[1] = new Array("15px", "18px", "22px", "25px", "27px", "27px", "27px", "27px", "26px", "26px", "26px", "28px", "32px", "36px", "41px", "46px", "51px", "55px", "56px", "57px", "56px", "56px", "55px", "55px", "55px", "56px", "63px", "69px", "75px", "81px");
    else
        document.MM_Time[0][0].values[1] = new Array(15,18,22,25,27,27,27,27,26,26,26,28,32,36,41,46,51,55,56,57,56,56,55,55,55,56,63,69,75,81);
    document.MM_Time[0][0].values[1].prop = "top";
    if (!ns4) {
        document.MM_Time[0][0].values[0].prop2 = "style";
        document.MM_Time[0][0].values[1].prop2 = "style";
    }
    document.MM_Time[0].lastFrame = 30;
    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}
//-->			

e eu adaptei uma folha de estilo para o tag/div ou sei lá o nome que se da...

<!-- INICIO DO CÓDIGO DO BANNER-->
body { background-image: url(galeria/background.png); }
#apDiv1 {
	position:absolute;
	width:200px;
	height:115px;
	z-index:1;
	left: 135px;
	top: 81px;
}

<!--BANNER FINAL DO CÓDIGO-->

Apreciaria se alguém pudesse me dar um HELP. Atenciosamente (Leandro Martins)



#2 Danilomaru

Danilomaru

    Ativo

  • Moderadores
  • 300 posts
  • Sexo:Masculino
  • Localidade:brasil

Posted 27/02/2015, 06:23

da uma olhada nesse tutorial :
 http://www.linhadeco...ntagem-de-tempo
talvez ajude



#3 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 14/09/2017, 03:38

Propecia Buy Uk Hair Follicles online pharmacy Viagra Generika 100 Mg
Sildenafil En Ligne 10 Mg Buy Prednisone Dose Pack
Want To Buy Doxycycline <a href=http://cialtobuy.com>cialis</a> Qu Es Propecia
Gd Sildenafil cialis Cheap Valtrex
Can Amoxicillin Be Taken With Prevacid Promosiones De Viagra Vente Levitra En Ligne
I Want To Order Cialis <a href=http://cialtobuy.com>cialis</a> Kamagra Plus

#4 JeffMalm

JeffMalm

    Super Veterano

  • Usuários
  • 12254 posts
  • Sexo:Feminino
  • Localidade:Mount Carey

Posted 19/12/2022, 19:58

buy viagra cialis online We noticed your browser language is Russian





Veja alguns posts relacionados com: javascript, java, html, xhtml, script

1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq