One idea for hiding results after vote

Find out what does your audience think

One idea for hiding results after vote

New postby 4creator » Sun Dec 07, 2014 9:46 am

Hi,

I was searching about hiding results after voting on this forum, but I could not find the solution. Simon said, "There is no way, to not show results after voting. It is one of the core functions of the poll.". Yes, you are right, I understand what you mean.

However, I want to use Sexy Polling as a tool for election. So I need to hide results after voting (at least until the "Date End" on Advanced Options of Poll).

I noticed that check box (before each Answer on frontend) is hidden after voting by components/com_sexypolling/assets/js/sexypolling_unpacked.js (ex. around line 442 - 446). I guess that sexypolling_unpacked.js add some styles when loading results.

I think, if I can hide Answers just like check box, it approaches to my goal of hiding results. So my idea is, adding "opacity: 0;" to style for label.

Expected results (HTML on frontend):
NOW:
Code: Select all
<label uniq_index="10000_3" class="twoglux_label">ANSEWER<div class="sexy_clear"></div></label>

EXPECT:
Code: Select all
<label uniq_index="10000_3" class="twoglux_label" style="margin-left: 0px; opacity: 0;">ANSEWER<div class="sexy_clear"></div></label>


For above idea, I tried to modify like followings;
BEFORE (line 449 - 452):
Code: Select all
//animate answers
$t.parent('span').parent('div').find('.answer_name label').animate({
   marginLeft:0
},1000);

AFTER:
Code: Select all
//animate answers
$t.parent('span').parent('div').find('.answer_name label').animate({
   marginLeft:0,
   opacity:0
},1000);


BEFORE (line 1057 - 1061):
Code: Select all
//animate answers
$container.find('.answer_name label').animate({
   marginLeft:0
},1000);

AFTER:
Code: Select all
//animate answers
$container.find('.answer_name label').animate({
   marginLeft:0,
   opacity:0
},1000);

BEFORE (line 1804):
Code: Select all
$new_li = '<li id="answer_' + $id + '" class="polling_li"><div class="animation_block"></div><div class="answer_name"><label style="margin-left:0;" uniq_index="' + ...

AFTER:
Code: Select all
$new_li = '<li id="answer_' + $id + '" class="polling_li"><div class="animation_block"></div><div class="answer_name"><label style="margin-left:0; opacity:0;" uniq_index="' + ...


Unfortunately, I am not good at JavaScript. So I could not get "Expected results". :cry:
Could you help me?

Thanks
4creator
 
Posts: 1
Joined: Sun Dec 07, 2014 7:40 am
Location: Japan

Return to Sexy Polling

Who is online

Users browsing this forum: No registered users and 4 guests

cron