Foros del Web » Creando para Internet » HTML »

animar olas del mar

Estas en el tema de animar olas del mar en el foro de HTML en Foros del Web. Hola como primer post en HTML5 Necesito si se puede con canvas crear el movimientos de las olas Usando css para dibujar las olas o ...
  #1 (permalink)  
Antiguo 30/09/2012, 16:37
 
Fecha de Ingreso: septiembre-2012
Mensajes: 3
Antigüedad: 11 años, 7 meses
Puntos: 0
animar olas del mar

Hola como primer post en HTML5
Necesito si se puede con canvas crear el movimientos de las olas
Usando css para dibujar las olas o de imagenes directamentes

actualmente estoy en un pegon:

Código:
   	<script type="text/javascript">
			var scrollSpeed = 1; 		// Speed in milliseconds
			var step = 1; 				// How many pixels to move per step
			var current = 0;			// The current pixel row
			var imageWidth = 1139;		// Background image width
			var headerWidth = 548;		// How wide the header is.1280
			
			//The pixel row where to start a new loop
			var restartPosition = -(imageWidth - headerWidth);
			
			function scrollBg(){
				//Go to next pixel row.
				current -= step;
				
				//If at the end of the image, then go to the top.
				if (current == restartPosition){
					current = 0;
				}
				
				//Set the CSS of the header.
				$('#header').css("background-position",current+"px 0");
			}
			
			//Calls the scrolling function repeatedly
			var init = setInterval("scrollBg()", scrollSpeed);				
</script>
con esto logro mover pero es de izquierda a derecha y lo quiero rebotando
ayuda por favor????

Etiquetas: canvas, css, html5, jquery
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:47.