- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Design’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I want to write a function call that checks a variable and updates the DOM on my page by increasing this heart size.
How do I increase this heart size with jquery?
The animation will override the transform
if it’s on the same element. You could target a parent element instead.
thanks. could you help me with this problem ive been having as well. how do I make the gold heart move faster? with this if statement ive written preferably https://codepen.io/anon/pen/KrwaQq
I think something like this?
function animateDiv(myclass) {
var newq = makeNewPosition();
if (myclass == '.heart.gold') {
$(myclass).animate({ top: newq[0], left: newq[1] }, 1000, 'linear', function() {
animateDiv(myclass);
});
}
else {
$(myclass).animate({ top: newq[0], left: newq[1] }, movingSpeed, 'linear', function() {
animateDiv(myclass);
});
}
}
I’ve optimised the script a bit: