Ver Mensaje Individual
  #7 (permalink)  
Antiguo 30/04/2013, 18:16
Avatar de laratik
laratik
 
Fecha de Ingreso: mayo-2010
Ubicación: Cali
Mensajes: 317
Antigüedad: 13 años, 10 meses
Puntos: 63
Respuesta: Dos javascript causan conflicto en una pagina.

Hola Laura_Berenice, copie y peque el código y me funciono tanto para el mensaje como para las imagenes, no se sira ya cuestión del navegador, lo prove tanto en IE como en Chrome.



Código Javascript:
Ver original
  1. <html>
  2. <head>
  3.     <title>Probando</title>
  4. </head>
  5. <body>
  6.     <TABLE BORDER="0" width="100%" align="CENTER" bgcolor="blue">
  7. <TR background="">
  8. <TD>
  9. <CENTER>
  10.  
  11.  
  12. <script type="text/javascript">
  13. var Textos = new Array();
  14.  // Enter the names of the images below
  15.  Textos[0]="Hola amigo internauta bienvenido a nuestra agencia de viajes.";
  16.  Textos[1]="Aqui encontraras la informacion de la mejores rutas turisticas.";
  17.  Textos[2]="Planea aqui tu ruta de sitios por recorrer segun tus necesidades.";
  18.  
  19. var nuevoTexto = -1;
  20. var totalTextos = Textos.length;
  21.  
  22. function repetir() {
  23.   nuevoTexto++;
  24.   if (nuevoTexto == totalTextos) {
  25.     nuevoTexto = 0;
  26.   }
  27.   document.getElementById('texto').innerHTML=Textos[nuevoTexto];
  28.  
  29.   setTimeout("repetir()", 4*1000);
  30. }
  31. window.onload=repetir;
  32. </script>
  33.  
  34.  
  35. <div id="texto" font style="color:#F9F9F9; font-size:x-small; font-family:Verdana" line-height: 1.35em>
  36. <!-- texto -->
  37. </div>
  38.  
  39.  
  40. </CENTER>
  41. </TD></TR>
  42. </TABLE>
  43. <TABLE BORDER="0" width="100%">
  44. <CENTER>
  45. <TR background="">
  46. <TD ALIGN="center" width="100%">
  47.  
  48.  
  49. <script language="JavaScript1.2">
  50. //Fade-in image slideshow- By Dynamic Drive
  51. //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
  52. //This credit MUST stay intact for use
  53. var slideshow_width='260px' //SET IMAGE WIDTH
  54. var slideshow_height='260px' //SET IMAGE HEIGHT
  55. var pause=500 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)
  56. var fadeimages=new Array()
  57. //SET IMAGE PATHS. Extend or contract array as needed
  58. fadeimages[0]="http://i190.photobucket.com/albums/z68/AC_Ociel_Sanchez/DefinesFotogramas01.png"
  59. fadeimages[1]="http://i190.photobucket.com/albums/z68/AC_Ociel_Sanchez/DefinesFotogramas02.png"
  60. fadeimages[2]="http://i190.photobucket.com/albums/z68/AC_Ociel_Sanchez/DefinesFotogramas03.png"
  61. fadeimages[3]="http://i190.photobucket.com/albums/z68/AC_Ociel_Sanchez/DefinesFotogramas04.png"
  62. fadeimages[4]="http://i190.photobucket.com/albums/z68/AC_Ociel_Sanchez/DefinesFotogramas05.png"
  63. fadeimages[5]="http://i190.photobucket.com/albums/z68/AC_Ociel_Sanchez/DefinesFotogramas06.png"
  64. ////NO need to edit beyond here/////////////
  65. var preloadedimages=new Array()
  66. for (p=0;p<fadeimages.length;p++){
  67. preloadedimages[p]=new Image()
  68. preloadedimages[p].src=fadeimages[p]
  69. }
  70. var ie4=document.all
  71. var dom=document.getElementById
  72. if (ie4||dom)
  73. document.write('<div style="position:relative;width:'+slideshow_width+';height :'+slideshow_height+';overflow:hidden"><div id="canvas0" style="position:absolute;width:'+slideshow_width+';height :'+slideshow_height+';top:0;left:0;filter:alpha(op acity=10);-moz-opacity:10"></div><div id="canvas1" style="position:absolute;width:'+slideshow_width+';height :'+slideshow_height+';top:0;left:0;filter:alpha(op acity=10);-moz-opacity:10"></div></div>')
  74. else
  75. document.write('<img name="defaultslide" src="'+fadeimages[0]+'">')
  76. var curpos=10
  77. var degree=10
  78. var curcanvas="canvas0"
  79. var curimageindex=0
  80. var nextimageindex=1
  81. function fadepic(){
  82. if (curpos<100){
  83. curpos+=10
  84. if (tempobj.filters)
  85. tempobj.filters.alpha.opacity=curpos
  86. else if (tempobj.style.MozOpacity)
  87. tempobj.style.MozOpacity=curpos/100
  88. }
  89. else{
  90. clearInterval(dropslide)
  91. nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
  92. tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
  93. tempobj.innerHTML='<img src="'+fadeimages[nextimageindex]+'">'
  94. nextimageindex=(nextimageindex<fadeimages.length-1)? nextimageindex+1 : 0
  95. setTimeout("rotateimage()",pause)
  96. }
  97. }
  98. function rotateimage(){
  99. if (ie4||dom){
  100. resetit(curcanvas)
  101. var crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
  102. crossobj.style.zIndex++
  103. var temp='setInterval("fadepic()",50)'
  104. dropslide=eval(temp)
  105. curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
  106. }
  107. else
  108. document.images.defaultslide.src=fadeimages[curimageindex]
  109. curimageindex=(curimageindex<fadeimages.length-1)? curimageindex+1 : 0
  110. }
  111. function resetit(what){
  112. curpos=10
  113. var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
  114. if (crossobj.filters)
  115. crossobj.filters.alpha.opacity=curpos
  116. else if (crossobj.style.MozOpacity)
  117. crossobj.style.MozOpacity=curpos/100
  118. }
  119. function startit(){
  120. var crossobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
  121. crossobj.innerHTML='<img src="'+fadeimages[curimageindex]+'">'
  122. rotateimage()
  123. }
  124. if (ie4||dom)
  125. window.onload= function () {
  126.     repetir();
  127.     startit();
  128. }
  129. else
  130. setInterval("rotateimage()",pause)
  131. </script>
  132.  
  133.  
  134. </TD>
  135. </TR>
  136. </CENTER>
  137. </TABLE>  
  138. </body>
  139. </html>
__________________
Programar apasiona y lo que apasiona es un arte, por lo tanto programar es un arte.

Quiero karma para en mi próxima vida ser un billonario bien dotado con alas.