Choose from our various pricing plans. There is a package for everyone!


like dislike with count

View previous topic View next topic Go down

Locked like dislike with count

Post by zenzo on Fri Mar 29, 2013 10:27 am

how can i make like dislike diagonal and with count like on this image



i have code here vote with count

javascript
Code:
(function($){
$(document).ready(function(){
$('.vote-bar').each( function() {
    var s = $(this).attr('title');
    var g = s.split("(");
    var n = g[1];
    var m = n.replace(")", "");
    $(this).children(".vote-bar-plus").html(m);
});
$('.vote a[href$="eval=plus"]').append(function(){
$(this).html('<img src="http://icons.iconarchive.com/icons/icojam/blue-bits/32/thumbs-up-icon.png"/>');
});
$('.vote a[href$="eval=minus"]').remove();
});
})(jQuery);

CSS
Code:
.vote-button img{opacity:0.3;}
.vote-button img:hover{opacity:1;}
.vote-bar-plus{color:#fff !important;padding-top: 4px;}
.vote .vote-bar{font-size:12px !important;border:1px solid #fff !important;width:100% !important;height: 22px !important;text-align: center;background: rgb(92, 91, 91);box-shadow: inset -3px -8px 19px rgba(0, 0, 0, 0.7);}
.vote{width: 6% !important;}
.vote .vote-bar-plus{background-color:transparent !important;}
avatar
zenzo
Member
Member

Age : 32
Posts : 10
Join date : 2013-03-25
Reputation : 3

View user profile

Back to top Go down

Locked Re: like dislike with count

Post by Th1nK on Fri Mar 29, 2013 9:06 pm

Have you tried to enter the codes in your forum?
avatar
Th1nK
Administrator
Administrator

Posts : 468
Join date : 2012-04-06
Reputation : 43

View user profile http://www.csshelp.net

Back to top Go down

Locked Re: like dislike with count

Post by zenzo on Fri Mar 29, 2013 10:07 pm

yes but its not like that on the image it look

so i need some help to modify the code and make like on the image
avatar
zenzo
Member
Member

Age : 32
Posts : 10
Join date : 2013-03-25
Reputation : 3

View user profile

Back to top Go down

Locked Re: like dislike with count

Post by Th1nK on Sat Mar 30, 2013 9:43 am

Maybe this code is copyrighted. Can you give me a link from where you downloaded it?
avatar
Th1nK
Administrator
Administrator

Posts : 468
Join date : 2012-04-06
Reputation : 43

View user profile http://www.csshelp.net

Back to top Go down

Locked Re: like dislike with count

Post by zenzo on Sat Mar 30, 2013 12:39 pm

i don't really remember but i think on avacweb forum


but its different from the code here i think,.
avatar
zenzo
Member
Member

Age : 32
Posts : 10
Join date : 2013-03-25
Reputation : 3

View user profile

Back to top Go down

Locked Re: like dislike with count

Post by Th1nK on Sat Mar 30, 2013 8:19 pm

I will test the code on my forum and try to make it work. Be patient Wink.
avatar
Th1nK
Administrator
Administrator

Posts : 468
Join date : 2012-04-06
Reputation : 43

View user profile http://www.csshelp.net

Back to top Go down

Locked Re: like dislike with count

Post by Irate on Wed May 01, 2013 10:17 am

Using Ajax for vote bars is only possible on Invision, punBB and phpBB3.

If you just want to replace the images, then you just need to refer to those images and add a .replace() function with jQuery.
avatar
Irate
Member
Member

Age : 21
Posts : 91
Join date : 2013-05-01
Forum Version : PhpBB2
Reputation : 2

View user profile http://duelacademy.net

Back to top Go down

Locked Re: like dislike with count

Post by Kilhen on Thu May 02, 2013 10:26 am

Here's an example, not a guarantee to work
Code:
var selectitems = document.getElementById("selectitems");
var items = selectitems.getElementsByTagName("option");
document.write('<p>The number is '+ items.length +'</p>');
]

try it:
Code:
$(function(){
$('.vote-bar').each( function() {
    var s = $(this).attr('title');
    var g = s.split("(");
    var n = g[1];
    var m = n.replace(")", "");
    $(this).children(".vote-bar-plus").html(m);
    var countUp = $(this).find('.vote-bar:has(".vote-bar-plus")').attr('title').split(" ")[3]; // 3 number of title;
    var countDown = $(this).find('.vote-bar:has(".vote-bar-minus")').attr('title').split(" ")[3]; // 3 number of title;
});
$('.vote a[href$="eval=plus"]').append(function(){
$(this).html('<img src="http://icons.iconarchive.com/icons/icojam/blue-bits/32/thumbs-up-icon.png"/>');
});
$('.vote a[href$="eval=minus"]').remove();
});

variable:
Code:
' +countUp+ ' and ' +countDown+ '
avatar
Kilhen
Member
Member

Age : 23
Posts : 9
Join date : 2012-05-21
Forum Version : PhpBB3
Reputation : 0

View user profile http://dworld.forumz.ro/

Back to top Go down

Locked Re: like dislike with count

Post by Dusan on Wed May 15, 2013 1:27 pm

User inactive and seems not to need help. Closed.
avatar
Dusan
Member
Member

Age : 22
Posts : 711
Join date : 2012-06-08
Forum Version : PunBB
Reputation : 36

View user profile http://www.csshelp.net

Back to top Go down

Locked Re: like dislike with count

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum