Do you have any idea why this happend? (Animated PNG)

  • Using code from Krpano examples have created pano where I am changing the url of animated PNG depending on language. Than I realized that there is strange behavior of the algorithm that is cropping the image -> it speeds up after several exchanges. In other words, when you change the language (URL of the PNG) several times the animations got much much faster. Tried several adaptations, initialization, but always the same happens. For you to see the behavior have prepared example for test. It is on the browser (Safari, Firefix, Chrome, IE, IPAD)

    Here it is: http://www.webonjee.com/radna-mapa/ant…nihotspots.html (click several times from ENG to HR and see how "animation" speeds up)
    XML: http://www.webonjee.com/radna-mapa/ant…anihotspots.xml

    Do you have any idea, proposal how to fix this. Will go in direction to prepare one PNG source and adapt the cropping zone (no URL change but CROP area from one source) depending on the chosen language and I am pretty sure this will do the trick, but would like to learn and identify this strange behavior.

    Einmal editiert, zuletzt von Umalo (21. März 2013 um 19:40)

  • Hi,

    the 'getting faster' happens because of the 'onloaded' event:

    Each time you set a new url, a new onloaded event will be called and so another new 'hotspot_animate' loop will be started...

    Depending on what you want to achieve, you need to adjust the code accordingly... e.g. remove the onloaded event after the first call...

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!