Skip to content

Variables/functions to eliminate repetition with playing each audio file #5

@joejohnmurphy

Description

@joejohnmurphy

For example, each button currently has code like this in the html file:
<div class='btn f seafood' tabindex='1'>seafood</div>
<audio id='seafood' controls style='display:none'><source src='sounds/seafood.mp3' type='audio/mpeg'> Your browser does not support the audio element.</audio>

And this in the talker.js file:
if ($(':focus').hasClass('seafood')) {document.getElementById('seafood').play()}

Is there a way to streamline this so the repetitive code is eliminated and there's just a list of words referenced?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions