Javascript-форум (https://javascript.ru/forum/)
-   Общие вопросы Javascript (https://javascript.ru/forum/misc/)
-   -   Подскажите с анимацией (https://javascript.ru/forum/misc/37018-podskazhite-s-animaciejj.html)

Vasy 06.04.2013 00:26

Цитата:

Сообщение от Ervin (Сообщение 244477)
Нечто похожее, да. Не так как на kindle, но что-то похожее, можно сделать. Завтра вечером скину source.

спасибо.буду вам признателен

Vasy 08.04.2013 11:41

А если сделать что-бы была такая анимация как я хочу тяжело или невозможно.То подскажите как сделать что-бы при нажатии на область <div> второй <div> рисовалса не через несколько секунд использую setTimeout а стили и текст менялись постепенно?

Vasy 09.04.2013 17:50

ребят подскажите пожалуста

Vasy 10.04.2013 13:58

Ам,нашол то что нужно.Пишут что нужно использовать Flip.Но некакой нормальной документации по этому свойству я ненашол.Ни примеров ни описания.
Можете подсказать как реализовать Flip?Чтобы прокрутка была вроде бы вы листаете тетрадь?
Вот где я нашол.http://lab.smashup.it/flip/

Vasy 10.04.2013 14:14

http://www.xiper.net/collect/js-plug...uery-flip.html
Пробую как пишут сдесь но ничево не работает.Подскажите как использовать Flip?

Ervin 10.04.2013 19:35

Сорри было лень сделать раньше. Вот то что я щас написал. Если добавить css стилей, вроде загнутого угла и тд. может получится что-то. Работает в
хроме.

function animate() {
	var el = document.getElementById("shape"),
		animation = {},
		model = (typeof el.style.webkitTransform !== "undefined") ? "webkitTransform" : (typeof el.style.MozTransform !== "undefined") ? "MozTransform" : "msTransform";
	
	el.removeEventListener("click", animate, false);
	
	animation = setInterval(function() {
		var transform = el.style[model],
			degree = +transform.replace(/[a-z\(\),\s-0]/g, ""),
			width = +el.style.width.replace("px", ""),
			left = +el.style.left.replace("px", "");
		
		if(width > 10) {
			el.style.width = (width - 10) + "px";
			el.style.left = (left + 10) + "px";
			el.style[model] = "skew(0deg," + (degree + 0.2) + "deg)";
		}
		else {
			clearInterval(animation);
			
			el.children[0].textContent = ["It's a beautiful life, oh oh ooh It's a beautiful life, oh oh ooh",
						"It's a beautiful life, oh oh ooh I just wanna be here beside you You can do what you want just seize the day",
						"What you're doing tomorrow's gonna come your way Don't you ever consider givin' up, you will find, ooh",
						"It's a beautiful life, oh oh ooh It's a beautiful life, oh oh ooh It's a beautiful life, oh oh ooh",
						"I just wanna be here beside you It's a beautiful life, oh oh ooh",
						"It's a beautiful life, oh oh ooh It's a beautiful life, oh oh ooh I just wanna be here beside you",
						"Beautiful, beautiful, beautiful Take a walk in the park when you feel down There's so many things there",
						"that's gonna lift you up See the nature in bloom a laughing child Such a dream, ooh"].join();
			
			animation = setInterval(function() {
				var transform = el.style[model],
					degree = +transform.replace(/[a-z\(\),\s-0]/g, ""),
					width = +el.style.width.replace("px", "");
				
				if(width < 250) {
					el.style.width = (width + 10) + "px";
					
					if(degree > 0.2) {
						degree = degree - 0.2;
						
						el.style[model] = "skew(0deg, -" + degree + "deg)";
					}
				}
				else {
					clearInterval(animation);
				}
			}, 10);
		}
	}, 10);
}

function bindAnimation() {
	var el = document.getElementById("shape");
	
	el.addEventListener("click", animate, false);
}

window.onload = bindAnimation;

#shape {
	margin: 50px;
	width: 250px;
	min-height: 300px;
	padding:5px;
	position:relative;
	background:#fff;
	background: -webkit-gradient(linear, 0% 20%, 0% 92%, from(#fff), to(#f3f3f3), color-stop(.1,#fff));
	background: -moz-linear-gradient(0% 0% 270deg, #fff, #fff 10%, #f3f3f3);
	border-top: 1px solid #ccc;
	border-right: 1px solid #ccc;
	border-left: 1px solid #ccc;
	-webkit-border-top-left-radius: 60px 5px;
	-moz-border-radius-topleft:60px 5px;
	border-top-left-radius:60px 5px;
	-webkit-border-top-right-radius: 60px 5px;
	-moz-border-radius-topright:60px 5px;
	border-top-right-radius:60px 5px;
	-webkit-box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.3) ;
	-moz-box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.3) ;
	box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.3) ;
	overflow:hidden;
}

.text {
	width:250px;
	height:300px;
}

<div id="shape" style="width:250px;"><div class="text">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div></div>


Я рекомендую использовать flip плагин.

Могу помочь разобраться почему не работает, если будет source code в котором ошибка.


Часовой пояс GMT +3, время: 02:45.