En este grupo En todos

Foro de Javascript



Problema con imagenes que giran al rededor del logo

ponciano garcia
Diseñador web c.i.c.a
Escrito por Ponciano Garcia Garcia
el 11/08/2012
Buenos días Johan .

Ojala y pudieras ayudarme, ya me e inscrito a mas de 5 foros y no encuentro solución a esta falla en el archivo. Tengo un archivo que me paso un amigo, para que yo lo adaptara a mis cambios. Pero sucede que al hacer
los cambios (modifico solo las líneas donde van las imágenes) no hace nada el archivo estoy ejecutando en dreamweaver 8 .

Aquí te pongo el código esperando tu ayuda..

girando fotos al rededor del mundo
-------------------------------------------------------------------------------- <html xmlns="https://www.w3.org/1999/xhtml" > <head runat="server"> <title>Llaves con Chip Mexico</title> <script language="javascript" type="text/javascript"> /************************************************** ****** Create a div with transparent place holder in your html <div id="Carousel" style="position:relative"> <img src="placeholder. Gif" width="404" height="202"> </div> placeholder width: 4 sided: 1. 42 * carousel image width + 3 6 sided: 2 * carousel image width +4 8 sided: 2. 62 * carousel image width + 5 12 sided: 3. 87 * carousel image width + 7 placeholder height: carousel image height+2 Insert onload in body tag <body onload="Carousel()"> ************************************************** *******/ // 7 variables to control behavior var Car_Image_Width=103; var Car_Image_Height=48; var Car_Border=true; // true or false var Car_Border_Color="white"; var Car_Speed=6; var Car_Direction=false; // true or false var Car_NoOfSides=12; // must be 4, 6, 8 or 12 /* array to specify images and optional links. For 4 sided carousel specify at least 2 images For 6 sided carousel specify at least 3 For 8 sided carousel specify at least 4 For 12 sided carousel specify at least 6 If Link is not needed keep it "" */ Car_Image_Sources=new Array( "fotos/acura. Gif","", "fotos/alfa-romeo. Gif","", "fotos/bmw. Gif","", "fotos/buick. Gif","", "fotos/byd. Gif","", "fotos/chevrolet. Gif","", //this slide isn't linked "fotos/corvette. Gif","", "fotos/daewoo. Gif","", "fotos/dodge. Gif","", "fotos/ferrari. Gif","", "fotos/ford. Gif","", "fotos/jeep. Gif","", "fotos/pontiac. Gif","", "fotos/suzuki. Gif","", "fotos/mercedes. Gif","", "fotos/chrysler. Gif","", "fotos/mazda. Gif","", "fotos/toyota. Gif","" // NOTE No comma after last line ); /***************** DO NOT EDIT BELOW **********************************/ CW_I=new Array(Car_NoOfSides/2+1);C_ClcW=new Array(Car_NoOfSides/2); C_Coef=new Array( 3*Math. PI/2,0,3*Math. PI/2,11*Math. PI/6,Math. PI/6,3*Math. PI/2,7*Math. PI/4, 0, Math. PI/4,3*Math. PI/2,5*Math. PI/3,11*Math. PI/6,0,Math. PI/6,Math. PI/3); var C_CoefOf=Car_NoOfSides==4? 0:Car_NoOfSides==6? 2:Car _NoOfSides==8? 5:9; C_Pre_Img=new Array(Car_Image_Sources. Length); var C_Angle=Car_Direction? Math. PI/(Car_NoOfSides/2):0,C_CrImg=Car_NoOfSides,C_MaxW,C_TotalW, C_Stppd=false,i,C_LeftOffset,C_HalfNo=Car_NoOfSide s/2; function Carousel(){ if(document. GetElementById){ for(i=0;i<Car_Image_Sources. Length;i+=2){ C_Pre_Img[i]=new Image();C_Pre_Img[i]. Src=Car_Image_Sources[i]} C_MaxW=Car_Image_Width/Math. Sin(Math. PI/Car_NoOfSides)+C_HalfNo+1; Car_Div=document. GetElementById("Carousel"); for(i=0;i<C_HalfNo;i++){ CW_I[i]=document. CreateElement("img");Car_Div. AppendChild (CW_I[i]); CW_I[i]. Style. Position="absolute"; CW_I[i]. Style. Top=0+"px"; CW_I[i]. Style. Height=Car_Image_Height+"px"; if(Car_Border){ CW_I[i]. Style. BorderStyle="solid"; CW_I[i]. Style. BorderWidth=1+"px"; CW_I[i]. Style. BorderColor=Car_Border_Color} CW_I[i]. Src=Car_Image_Sources[2*i]; CW_I[i]. Lnk=Car_Image_Sources[2*i+1]; CW_I[i]. Onclick=C_LdLnk; CW_I[i]. Onmouseover=C_Stp; CW_I[i]. Onmouseout=C_Rstrt} CarImages()}} function CarImages(){ if(! C_Stppd){ C_TotalW=0; for(i=0;i<C_HalfNo;i++){ C_ClcW[i]=Math. Round(Math. Cos(Math. Abs(C_Coef[C_CoefOf+i]+C_Angle))*Car_Image_Width); C_TotalW+=C_ClcW[i]} C_LeftOffset=(C_MaxW-C_TotalW)/2; for(i=0;i<C_HalfNo;i++){ CW_I[i]. Style. Left=C_LeftOffset+"px"; CW_I[i]. Style. Width=C_ClcW[i]+"px"; C_LeftOffset+=C_ClcW[i]} C_Angle+=Car_Speed/720*Math. PI*(Car_Direction? -1:1); if(Car_Direction&&C_Angle<=0)||(! Car_Direction&&C _Angle>=Math. PI/C_HalfNo)){ if(C_CrImg==Car_Image_Sources. Length)C_CrImg=0; if(Car_Direction){ CW_I[C_HalfNo]=CW_I[0]; for(i=0;i<C_HalfNo;i++)CW_I[i]=CW_I[i+1]; CW_I[C_HalfNo-1]. Src=Car_Image_Sources[C_CrImg]; CW_I[C_HalfNo-1]. Lnk=Car_Image_Sources[C_CrImg+1]} else{ for(i=C_HalfNo;i>0;i--)CW_I[i]=CW_I[i-1]; CW_I[0]=CW_I[C_HalfNo]; CW_I[0]. Src=Car_Image_Sources[C_CrImg]; CW_I[0]. Lnk=Car_Image_Sources[C_CrImg+1]} C_Angle=Car_Direction? Math. PI/C_HalfNo:0;C_CrImg+=2}} setTimeout("CarImages()",40)} function C_LdLnk(){if(this. Lnk)window=location.href.this. Ln k} function C_Stp(){this=style.cursor.this. Lnk? "pointer":"defa ult";C_Stppd=true;} function C_Rstrt(){C_Stppd=false} </script> </head> <body onload="Carousel()"> <form id="form1" runat="server"> <div center> <div center id="grande" style="z-index: 101; left: 139px; width: 620px; top: 7px; height: 65px; vertical-align: middle; text-align: justify; position: relative;"> &nbsp; <asp:Image ID="Image1" runat="server" Height="343px" ImageUrl="~/image/mundotransparente. Gif" Width="382px" /> <div id="Carousel" style="z-index: 101; left: 0px; width: 419px; top: -220px; height: 65px; vertical-align: middle; text-align: justify; position: relative;"> </div> </div> </DIV> <asp:DropDownList ID="DropDownList1" runat="server" Width="110px"> </asp:DropDownList> </form> </body> </html>

te soy cinsero es mi primera ves con un archivo javascript.
Saludos cordiales tu seguro servidor.
Ponciano Garcia.