tonybabb
02-20-2015, 01:31 PM
Good morning,
I'm building a smartphone app that is essentially a talking Spanish phrasebook using topics where the user can find related English/ Spanish phrases for each topic.
I would like to give my users the ability to search the app for English words/ phrases and display the English word/ phrase followed by up to 3 Spanish phrases. I think I could use the jQuery "contains" selector to select the English phrases, but I think I have two problems:
1) How would I also select up to three Spanish phrases that immediately follow it?
2) How would I copy the results (English/ Spanish phrases) to the search page?
Below is a section of code showing a couple of English phrases one followed by two Spanish phrases and the other followed by one Spanish phrase
<div class="english">
You are under arrest
</div> <!-- End English -->
<div class="wrapper">
<a class="formal spanish" data-ignore="true" href="arrUnderArrestF.mp3">F: Está bajo arresto</a>
<a class="informal spanish" data-ignore="true" href="arrUnderArrestI.mp3">I: Estás bajo arresto</a>
</div> <!-- End .wrapper -->
<div class="english">
I have an arrest warrant
</div> <!-- End English -->
<div class="wrapper">
<a class="spanish" data-ignore="true" href="arrArrestWarrant.mp3">Tengo una orden de arresto</a>
</div> <!-- End .wrapper -->
Thanks in advance for any suggestions.
Tony
I'm building a smartphone app that is essentially a talking Spanish phrasebook using topics where the user can find related English/ Spanish phrases for each topic.
I would like to give my users the ability to search the app for English words/ phrases and display the English word/ phrase followed by up to 3 Spanish phrases. I think I could use the jQuery "contains" selector to select the English phrases, but I think I have two problems:
1) How would I also select up to three Spanish phrases that immediately follow it?
2) How would I copy the results (English/ Spanish phrases) to the search page?
Below is a section of code showing a couple of English phrases one followed by two Spanish phrases and the other followed by one Spanish phrase
<div class="english">
You are under arrest
</div> <!-- End English -->
<div class="wrapper">
<a class="formal spanish" data-ignore="true" href="arrUnderArrestF.mp3">F: Está bajo arresto</a>
<a class="informal spanish" data-ignore="true" href="arrUnderArrestI.mp3">I: Estás bajo arresto</a>
</div> <!-- End .wrapper -->
<div class="english">
I have an arrest warrant
</div> <!-- End English -->
<div class="wrapper">
<a class="spanish" data-ignore="true" href="arrArrestWarrant.mp3">Tengo una orden de arresto</a>
</div> <!-- End .wrapper -->
Thanks in advance for any suggestions.
Tony