Не работает Raphael
Добрый день! У меня проблема, не работает анимация. http://jsfiddle.net/BS6j6/902/ - здесь работает, а вот браузер игнорирует. Проверял в Chrome и Firefox/ вот код:
<!doctype html> <html> <head> <meta charset="UTF-8"/> <title>SVG</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="raphael.js"></script> <script type="text/javascript" src="mysvg.js"></script> </head> <body> <div id="main" style="width: 500px; height: 500px; margin: 50px auto; border: 1px solid #000;"> </div> </div> </body> </html> и код моей JS: var paper = Raphael('main', 500, 500); // Creates circle at x = 50, y = 40, with radius 10 var line_1 = paper.path( ["M", 100, 100, "L", 30, 100 ] ).attr({'stroke': '#000','stroke-width':'3'}); var line_2 = paper.path( ["M", 200, 200, "L", 30, 200 ] ).attr({'stroke': '#000','stroke-width':'3'}); line_1.rotate(200,100,100); line_2.rotate(100, 200, 200); // to animate ?? line_1.animate({rotation:"300 100 100"},1000,'<>'); line_2.animate({rotation:"300 200 200"},1000,'<>'); Что не так? Подскажите! |
Может потому что, Raphael не может найти блок #main, тк на момент выполнения скрипта его нет в DOM?
Попробуйте перенести <script type="text/javascript" src="mysvg.js"></script> вниз body. |
WorM32,
Все равно не работает. Пробовал. |
Часовой пояс GMT +3, время: 23:19. |