Use custom image for Google+1 button?

前端 未结 9 2205
粉色の甜心
粉色の甜心 2020-12-04 16:28

I want to include a \"google+1\" button on a page, yet I want to use a custom image with a custom size for it and preferably without javascript, much like is possible to do

9条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 17:00

    If you were willing to use JavaScript, this will give a more official experience.

    HTML

    
        Google+ +1 Button
    
    

    JavaScript

    function gPlus(url){
        window.open(
            'https://plus.google.com/share?url='+url,
            'popupwindow',
            'scrollbars=yes,width=800,height=400'
        ).focus();
        return false;
    }
    

    If you include that function globally, you can have such buttons all over the place without using multiple, lengthy, in-line onClicks.

提交回复
热议问题