Drupal: Display poll radio to Button and show result on click of choice

This CodeLet will Dispaly poll choice radio as a Button and view result on click of button.

Module Info

name = Custom
description = Custom feature
core = 7.x
package = custom
scripts[] = custom.js
stylesheets[all][] = custom.css

CodeLet: 

custom.css file

.vote-form input[type="radio"].form-radio, .vote-form -vote {
display:none;
}
.vote-form input[type="radio"].form-radio + label{
background-image: -moz-linear-gradient(bottom,,);
background-image: -webkit-gradient(linear,0 0,0 100%,from(),);
background-image: -webkit-linear-gradient(bottom,,);
background-image: -o-linear-gradient(bottom,,);
background-image: linear-gradient(to top,,);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='',endColorstr='',GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
-webkit-box-shadow: inset 0 1px 6px rgba(41, 41, 41, 0.2),0 1px 2px rgba(0,0,0,0.05);
-moz-box-shadow: inset 0 1px 6px 0 rgba(41, 41, 41, 0.2),0 1px 2px rgba(0,0,0,0.05);
box-shadow: inset 0 1px 6px rgba(41, 41, 41, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);
cursor: pointer;
color: ;
font-weight:bold;
border-color: transparent;
text-shadow: 0 1px 1px rgba(40, 40, 40, 0.75);
border-radius:5px;
padding:5px
}

.vote-form input[type="radio"].form-radio:checked + label {
background-image: -moz-linear-gradient(bottom,,);
background-image: -webkit-gradient(linear,0 0,0 100%,from(),);
background-image: -webkit-linear-gradient(bottom,,);
background-image: -o-linear-gradient(bottom,,);
background-image: linear-gradient(to top,,);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='',endColorstr='',GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
-webkit-box-shadow: inset 0 1px 6px rgba(41, 41, 41, 0.2),0 1px 2px rgba(0,0,0,0.05);
-moz-box-shadow: inset 0 1px 6px 0 rgba(41, 41, 41, 0.2),0 1px 2px rgba(0,0,0,0.05);
box-shadow: inset 0 1px 6px rgba(41, 41, 41, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);
cursor: default;
color: ;
font-weight:bold;
border-color: transparent;
text-shadow: 0 1px 1px rgba(40, 40, 40, 0.75);
border-radius:5px;
padding:5px

}

.vote-form input[type="radio"].form-radio + label {
width: 3em;
}

.vote-form input[type="radio"].form-radio:checked + label.btn:hover {
background-color: inherit;
background-position: 0 0;
-webkit-transition: none;
-moz-trainsition: none;
transition: none;
}

custom.js
jQuery(document).ready(function(){

jQuery(".vote-form input[type=\"radio\"].form-radio").click(function(){
jQuery(this).closest("form").submit();
});
});

Drupal: Poll radio to Button

By saru1683 on Sat, 31/05/2014 - 9:45am

Add comment

Log in or register to post comments
QR code for this page URL This page URL
Feedback