Slider Revolution WP
09.27.2016
Some of you wanted to have the same Social Sharing in the Grid Items as we presented in our themepunch.com/essential Header content. So we just wanted to give you a short HOW TO here.
<a class="shareme" href="#" data-social='{"type":"facebook", "url":"%eg-demogrid-link%", "text":"All-Purpose Grid Building Solution for WordPress"}' title="Share this">
<div class="headerlikes hlfblike"><i class="icon-facebook headerlikesicon" style="font-size:17px" ></i>
<div class="likesamount" data-url="%eg-demogrid-link%" data-liketype="facebook">0</div>
</div></a><a class="shareme" href="#" data-social='{"type":"twitter", "url":"%eg-demogrid-link%", "text":"All-Purpose Grid Building Solution for WordPress"}' title="Share this">
<div class="headerlikes hltwlike"><i class="icon-twitter headerlikesicon" style="font-size:17px" ></i>
<div class="likesamount" data-url="%eg-demogrid-link%" data-liketype="twitter">0</div>
</div></a><a class="shareme" href="#" data-social='{"type":"pinterest", "url":"%eg-demogrid-link%", "text":"All-Purpose Grid Building Solution for WordPress"}' title="Share this">
<div class="headerlikes hlpinterest"><i class="icon-s-pinterest headerlikesicon" style="font-size:17px" ></i>
<div class="likesamount" data-url="%eg-demogrid-link%" data-liketype="pinterest">0</div>
</div></a><a class="shareme" href="#" data-social='{"type":"plusone", "url":"%eg-demogrid-link%", "text":"All-Purpose Grid Building Solution for WordPress"}' title="Share this">
<div class="headerlikes hlgplus lastlikes"><i class="icon-gplus headerlikesicon" style="font-size:17px" ></i>
<div class="likesamount" data-url="%eg-demogrid-link%" data-liketype="google">0</div>
</div></a>
1 2 3 4 5 6 7 8 9 10 11 12 13 |
/* Name: jqSocialSharer Type: jQuery Plugin Version: 2.1 Author: Tirumal Website: www.code-tricks.com Plugin URL: https://code-tricks.com/customized-jquery-social-sharing-pop-up-window/ Description: jQuery Social Sharer Plugin License: GNU GENERAL PUBLIC LICENSE V2.0 */ (function ($){$["fn"]["jqSocialSharer"]=function (options){var settings=$["extend"]({"popUpWidth":550,"popUpHeight":450,"popUpTop":100,"useCurrentLocation":false},options);return this["each"](function (index,value){$(this)["bind"]("click",function (evt){evt["preventDefault"]();var social=$(this)["data"]("social"),width=settings["popUpWidth"],height=settings["popUpHeight"],sHeight=screen["height"],sWidth=screen["width"],left=Math["round"]((sWidth/2)-(width/2)),top=settings["popUpTop"],url,useCurrentLoc=settings["useCurrentLocation"],socialURL=(useCurrentLoc)?window["location"]:encodeURIComponent(social["url"]),socialText=social["text"],socialImage=encodeURIComponent(social["image"]);switch(social["type"]){case "facebook":url="https://www.facebook.com/sharer/sharer.php?s=100x26p[url]="+socialURL+"x26p[images][0]="+socialImage+"x26p[title]="+socialText+"x26p[summary]="+socialText;break ;;case "twitter":url="https://twitter.com/share?url="+socialURL+"x26text="+socialText;break ;;case "plusone":url="https://plusone.google.com/_/+1/confirm?hl=enx26url="+socialURL;break ;;case "pinterest":url="https://pinterest.com/pin/create/button/?url="+socialURL+"x26media="+socialImage+"x26description="+socialText;break ;;} ;window["open"](url,"","left="+left+" , top="+top+", width="+width+", height="+height+", personalbar=0, toolbar=0, scrollbars=1, resizable=1");} );} );} ;} (jQuery));jQuery(".shareme").jqSocialSharer(); |
SOCIAL SHARE ALTERNATIVE EXAMPLE