-2

I have been looking down to a pendulum in html5 and jquery, i found this example on a website...

http://www.webdevdoor.com/javascript-ajax/jquery-pendulum-animation-pivot-point/

I embedded with customization to my website, i have read the documentation of this mentioning that this will not work on Ie8 and older versions of firefox and safari, after arranging all my UI together, it seems to be a problem with it in IE9...

I dnt know what but the example is working not my demo...

Example:-

http://www.webdevdoor.com/demos/html5-pendulum-demo/

My demo:-

http://jsfiddle.net/sZzy6/2/

Screenshot:-

Ie9 demo

My JS:-

$(document).ready(function(){
    var rotation = 7;
    var swingtime = 1603;
    var swinger = $('.pendulum-parent');

function init() {
            swinger.animate({rotate: rotation}, 0, function () {
                swinger.css("display", "block");
                rotation *= -1;
                pendulumswing1();
            });
}
function pendulumswing1() {
            swinger.animate({rotate: rotation},swingtime, "swing", function(){
                 rotation *= -1;
                 pendulumswing1();
            });
        }
init();

    });

Any solution for the above? Where i have been mistaken? or its an OS or Browser issue?

SaurabhLP
  • 3,619
  • 9
  • 40
  • 70
  • 1
    I would double check that your IE9 instance isn't running in IE8 compatibility mode, or something like that. – element119 Jun 21 '13 at 15:49
  • @autibyte yes, it's working in IE-10 and IE-9, But not working in IE-8,IE-7 and IE-10 compatibility mode. – Ishan Jain Jun 22 '13 at 03:58
  • Works for me in IE9 too. Your probelm seems really localized too your computer (OS/softawre/hardware maybe). Have you tested it on other computer? – A. Wolff Jun 29 '13 at 13:14
  • Just to be sure what is your IE version from About Internet Explorer in Tools. Follow the instructions given here http://www.enable-javascript.com/ to verify JavaScript is working. Also try browsing with anti-virus/addons disabled so that it does not interfere with JavaScripts on JSfiddle. – user568109 Jul 01 '13 at 18:57

2 Answers2

2

I'm not sure if you've already fixed this however both the jsfiddle and the demo website work in IE9. I am running this in IE10 however the browser mode should perfectly emulate the CSS and JavaScript capabilities. This might point to an external problem with your browser.

Also here's a slight simplification of the fiddle

$(function(){   

    var rotation = 7;
    var swingtime = 1603;
    var swinger = $('.pendulum-parent');
    swinger.css("display", "block");

    function pendulumSwing(first) {
        swinger.animate({rotate: rotation},swingtime, first? 0 : "swing", function(){
                 rotation *= -1;
                 pendulumSwing();
            });
        }
    pendulumSwing(true);

});

And a screen shot we can see it does in fact work. enter image description here

Daniel Little
  • 16,975
  • 12
  • 69
  • 93
  • hi thanks for reply, i am using ie9, but fiddle demo is not at all working in both ie9 and ie10 compatibility mode.... your mentioned fiddle demo is also not working in ie9... – SaurabhLP Jun 22 '13 at 04:45
-1

Your code is working as you provided it.

I'm using Internet Explorer 10 with IE9 Browser mode and it works fine.

Here's a screenshot of the pendulum working just clicking on the Run option:

jQuery Pendulum on IE10 with IE9 Browser mode

Community
  • 1
  • 1
Ricardo
  • 112
  • 3
  • 5
  • 15