Giter Club home page Giter Club logo

Comments (12)

legomushroom avatar legomushroom commented on April 29, 2024 1

Hey @Oguima !

You mean transform with CSS or JS?
SVG has numerous issues with transforms defined in CSS.
Setting transform directly on element with transform attribute should work everywhere though:

<g id="termometro" transform="translate(0, -70px)">

Thanks

from mojs.

Oguima avatar Oguima commented on April 29, 2024

Testing ... Now :D Thanks

from mojs.

Oguima avatar Oguima commented on April 29, 2024

I try:
//termometro.style['transform'] = 'translate(0 ,' + -70 + 'px)'; //Ok firefox, safari, chrome... not IE
termometro.setAttribute("transform", 'translate(0, ' + -70*progress + 'px)');

Error: Invalid value for attribute transform="translate(0, -70px)"

from mojs.

legomushroom avatar legomushroom commented on April 29, 2024

@Oguima surely. remove pixels:

termometro.setAttribute("transform", 'translate(0, ' + (-70*progress) + ')');

from mojs.

Oguima avatar Oguima commented on April 29, 2024

Good news for me, work :D.
I have problens with transitions ...
transition: all 1s;
or
transition: transform 1s;
Via CSS, no work. (For SVG elements)

Via mojs, work, partial. I need more tests for this.
Removed transition ... i try to go to 0 transform ...
Whow to transform to (0,0) ?

 new mojs.Tween({
            repeat:   1,
            delay:    0,
            duration: 2000,
            onUpdate: function (progress) {
                termometro.setAttribute("transform", 'translate(0, ' + 1*progress + ')');
            }
        }).run();

from mojs.

legomushroom avatar legomushroom commented on April 29, 2024
termometro.setAttribute("transform", 'translate(0, ' + 70*(1-progress) + ')');

from mojs.

Oguima avatar Oguima commented on April 29, 2024

Works... but 2 times ?!? ...
I removed repeat: 1 ... And Works Fine , thanks

termometro.setAttribute("transform", 'translate(0, ' + -70*(1-progress) + ')');

from mojs.

legomushroom avatar legomushroom commented on April 29, 2024

@Oguima exactly. You have 1 repeat loop, so it will run 2 times.

from mojs.

Oguima avatar Oguima commented on April 29, 2024

I try with WAAPI, and not work ... with SVG. works fine with divs ...
mojs , works fine with SVG NOW :D

achievement unlocked:

  • SVG transform: translate on IE

Thanks

from mojs.

legomushroom avatar legomushroom commented on April 29, 2024

np

from mojs.

Oguima avatar Oguima commented on April 29, 2024

Sample Works Fine: Click on termometer, UP and Down - works on IE.

  • SVG transform: tranlate on IE - With: mojs

http://codepen.io/Oguima/pen/WreNVR

from mojs.

legomushroom avatar legomushroom commented on April 29, 2024

yay!

from mojs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.