I’ve checked a few other posts, but can’t find a definitive answer. Currently, for simple cards with a front and a back, I have the following html:
<section id="answer" class="simple simple-reverse">
So on reveal the reverse card scrolls to the answer
id. Is there any sane way to do this for a given {{c1::cloze field}}
?
I often have multiple cloze fields in one note
Sometimes these are on the same card …
Sometimes the note creates multiple cloze cards
Without javascript , is this possible (on AnkiMobile and desktop)? Or can I suggest a feature for this?
I guess you’d have to have numbered id
s for each cloze card and scroll to the first one.
1 Like
abdo
February 4, 2024, 3:02pm
2
Not possible without JavaScript.
1 Like
That’s a shame. I often have cards who’s cloze/answer are below the fold so can’t be seen very quickly. Is the javascript particularly involved to do this? I’d prefer not to use JS anyway though.
abdo
February 4, 2024, 11:01pm
4
It’s actually pretty simple. This works for me in the front/back templates:
<script>
onUpdateHook.push(() => {
document.querySelector(".cloze[data-ordinal='1']").scrollIntoView();
});
</script>
5 Likes
Cool. That seems quite straight forward thanks.
system
Closed
March 8, 2024, 1:54pm
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.