I have the following jquery function in a project and would like to convert it to Dom7. If this succeeds, jquerry would be redundant in the project.
Unfortunately I do not succeed, can someone please help me with this?
$(stage).animate({
"top": "+800px"
}, "fast", function() {
finalquestion = false;
});
What is your ‘stage’ object?
Stage is a div containing a content block.
kerrydp
February 5, 2022, 11:07pm
4
Have you declared access to it in a different method than a standard ID or class selector? The reason I ask is you have $(stage) with no selector, a better usage would be:
$('.stage').animate // (for class='stage')
$('#stage').animate // (for ID='stage')
My HTML looks like:
<div id="stage">...</div>
var $ = Dom7;
$('#stage').animate({
"top": "+800px"
}, "fast", function() {
finalquestion = false;
});
The use of ‘$’ relies on not having jQuery in your project. If you are also using jQuery alongside F7, change $
to $$
var $$ = Dom7;
And then use $$.
as the reference.
deejay
February 6, 2022, 5:29pm
7
jquery is obsolete (years ago)
you should not use it anyway
here is the syntax of Dom7.animate:
$('#stage').animate({
'attr': 'value'
},{ complete: () => console.log('completed') });
source => Dom7 - Custom DOM Library | Framework7 Documentation