Ricard Torres on "[Plugin: Thumbs Rating] Add class to non-clicked element"

ساخت وبلاگ

AlexanderCnb
Member
Posted 9 hours ago #

If I understand the script correctly, it adds a class to the clicked element (thumbs-rating-voted). Would it be possible for it to also add a class to the non clicked element after there has been voted?

Thank you!

Absolutely, you just need to change the part of JavaScript to something like:

if( type == 1){ thumbs_rating_class = ".thumbs-rating-up"; var other_class = ".thumbs-rating-down"; }
else{ thumbs_rating_class = ".thumbs-rating-down"; var other_class = ".thumbs-rating-up"; }
jQuery(new_container + thumbs_rating_class ).addClass('thumbs-rating-voted');
jQuery(new_container + other_class ).addClass('other-class');

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 117 تاريخ : جمعه 17 ارديبهشت 1395 ساعت: 13:28