- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
i have a function like ths
$(“.nav_button”).click(function() {
$(“.slides”).animate({ animation properties here });
});
What i want todo is store the animation properties in a separate jquery file and call that file with that function. And the animation occurs according to the properties in the external file. And how would the properties in the external file be written?
Something like this:
var animationOptions = {
duration : 400,
easing : ‘swing’
}
$(‘.slides’).animate({
height: 10
}, animationOptions);
External file could be JSON and call it with GET.
$.getJSON(‘/path/to/file.json’, function(data) {
console.log(data); // verify it works
});
@CrocoDillon but how would the animation properties be written in the JSON file? This is the animation i have
$(“.slides”).animate({left:’100%’});
How would that be written in the JSON file?
I’m guessing `{left:’100%’}`, in a file named .json could work.