0
I have the following function:
$.keyframe.define([{
name: 'tocaSlide',
tMin : {'margin-left': tempoImagens},
tMax : {'margin-left': tempoImagens},
}]);
But I need to insert '%' after the variables, as below:
$.keyframe.define([{
name: 'tocaSlide',
tMin'%' : { margin-left:-tempoImagens'%'},
tMax'%' : { margin-left:-tempoImagens'%'}
}]);
The way I did, it’s a mistake.
What is the correct way to concatenate into parameters of the $.keyframe.define
?
I’ve tried that too, but it makes a mistake on the right side of the two points:
$.keyframe.define([{
name: 'tocaSlide',
tMin + '%' + : { margin-left:-tempoImagens + '%' + },
tMax + '%' + : { margin-left:-tempoImagens + '%' + }
}]);
I even got it the way down:
'%' : { "margin-left":-tempoImagens + "%"}, '%' : { "margin-left":-tempoImagens + "%"},
But when I add the variable Tmin and tmax on the left side of the error:
tMin + "%" : { "margin-left":-tempoImagens + "%"},
tMax + "%" : { "margin-left":-tempoImagens + "%"},
See if you can’t do it just like this: Tmin+'%' in javascrip/jQuery uses + to concatenate
– AnthraxisBR
that is the problem, already try so too but it does not work:
– Carlos Rocha
And so you tried: 'Tmin%': { 'margin-left:-timeImagens%'}, ? I took this example from Docs
– AnthraxisBR
I can’t because Tmin is a variable
– Carlos Rocha
Then Tmin comes from a certain value ? if that’s it you have to add % already where mounts the variable
– AnthraxisBR
No, Tmin and tmax receive different values with each iteration of a for loop;
– Carlos Rocha
Have you tried concatenating inside the loop ?
– AnthraxisBR
Aim, but how do I print the result of a text variable that contains all the string within the function $.keyframe.define([{ ???
– Carlos Rocha
Before entering $.keyframe makes an alias, var tMinConcat = Tmin+'%'; and inside of the function puts tMinConcat, I think you will get it so
– AnthraxisBR
It’s kind of confusing for me, you could post an answer with this solution doing favor?
– Carlos Rocha
It’s just that I’m not sure if it’s gonna work out, but I’m gonna answer right there
– AnthraxisBR
let’s try, hope is the last that dies
– Carlos Rocha