I am working with the WP Easy Poll plugin for a site where there people will vote for nominees in different categories. When you use this WP Easy Poll Plugin, you click on the Name of the Nominee and bars animate and show you the number of votes or you have an option to show a percentage of the votes counted. This is done through jquery and PHP.
I want people to be able to vote online but I don’t want them to see whose winning until the awards are handed out. So I thought an easy fix would be to use an attribute selector to hide the number of votes but when I do that it hides both the name of the nominee and the votes. I can’t just select one – can someone help? I tried everything 🙁
Here is the selector I tried to use to hide the “20%” next to Dikla Carmel:
div[data-myo-perc="yes"]{display:none;}
<div data-myo-poll-id="334" data-myo-clicked="yes" data-myo-option="0" data-myo-perc="yes" class="myo-poll-votes myo-poll-334 myo-poll-bar" id="myo-poll-334-votes-0" style="cursor: default;">Dikla Carmel 20%</div>
This did not work. It would take out both the nominee’s name and the “20%”. All I want to do is hide the “20%” until the day after the awards show and then the voters can go online and see by how much the winner won. The attribute for the name is id=”myo-poll-340-votes-1″ so I don’t understand why it selects the name and percentage. I’ve tried everything. . .
div[data-myo-perc*="yes"]{display:none;} ---> No good
div[data-myo-perc^="yes"]{display:none;} ---> No good
div[data-myo-perc~="yes"]{display:none;} ---> No good
div[data-myo-perc$="yes"]{display:none;} ---> No good
I’m trying to do this for a client – but now I am starting to get confused and I have run out of ideas.
Can anyone help? I looked in the js. and css. files and nothing.
You can see the demo of the plugin here –> WP Polling Link Demo
You cannot isolate part of the text if it isn’t selected. You need a way to target it.
jsFiddle here
This does what you are trying to achieve. It effectively hides the percentage, yet displays the name.
HTML
CSS