"SELECT TEXT AND SHARE IT ON TWITTER" WIDGET FOR BLOGGER

This is an efficient twitter widget for blogger blog which makes it easy for your readers to share any piece of text to twitter. This widget allows your blog visitors to tweet selected text on twitter easily. Whenever a visitor visit your blog and select any line of text a small black colored twitter tweet button will be visible now if your readers want that selected line to be tweeted on twitter then they just have to click on that black colored twitter button. Here is a screenshot of this widget that you can see how actually it works.


HOW TO ADD "SELECT TEXT AND SHARE IT ON TWITTER" WIDGET IN BLOGGER?



To install this widget on blog, Just follow the easy steps given below: Go to Blogger Dashboard> Template> Edit HTML Press CTRL + F to enable search box then Search for
[]]></b:skin>]
Now, Copy and paste the following CSS code just above it.

.BWGSharetip {
display:none;
top:0;
background:#333;
color:#f16786;
width:40px;
height:32px;
position:absolute;
margin-left:-20px;
opacity:0;
filter:alpha(opacity=0);
z-index:99;
-webkit-transition:all .3s ease;
-moz-transition:all .3s ease-in-out;
-o-transition:all .3s ease;
transition:all .3s ease-in-out;
}
.BWGSharetip span {
position:absolute;
content:" ";
border:solid rgba(0,0,0,0);
height:0;
width:0;
top:100%;
border-top-color:#333;
left:50%;
-webkit-transition:all .3s ease;
-moz-transition:all .3s ease-in-out;
-o-transition:all .3s ease;
transition:all .3s ease-in-out;
border-width:7px;
margin:0 0 0 -7px;
}
.BWGSharetip a {
color:#f16786;
}
.BWGSharetip:hover {
background:#3D566E;
}
.BWGSharetip:hover span {
border-top-color:#3D566E;
}
.tooltipContainer {
position:relative;
display:block;
width:100%;
height:100%;
top:0;
left:0;
}
.tooltipContainer a {
width:100%;
background:transparent  url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghAsEwniAbNEZNFmSGgT8Ms3q1m0vwSqurs6_q64TreDHC_7H0o6rg2bTqIB8AqNdwG2u2nFqhfVnVRl0CTFDb_ZXEuT4683vmO-KblBcoWYm3j-Tnkivj54a2SR8IxIXI4-X_hGi2B9OE/s1600/sprites.png)  0 0 no-repeat;
left:0;
top:0;
height:100%;
text-decoration:none;
display:block;
padding:0;
}
.sharingLink {
display:block;
position:absolute;
text-indent:-9999px;
}

Next search for </head> tag and copy paste the following code just above it.

<script type='text/javascript'>
 /*<![CDATA[*/
 $(document).ready(function() {
    textToShare = '';
    $(document).mousemove(function(m) {
        generateTooltipPosition();
    });
});
$(document).mouseup(function() {
    $(document).mousemove(function(m) {
        generateTooltipPosition()
    });
    var textToShare = getTextToShare();
    var BWGSharetip = document.getElementById("BWGSharetip");
    if (textToShare != '') showMeTooltip();
});
$(document).click(function() {
    var textToShare = getTextToShare();
    var tooltipTitle = null;
    var newTooltipTitle = $("#BWGSharetip").attr("title");
    if (newTooltipTitle == "") return;
    if (newTooltipTitle !== tooltipTitle) $('#BWGSharetip').animate({
        opacity: 0
    }, 30);
    if (textToShare != "") showMeTooltip();
});
$(window).resize(function() {
    if ($('#BWGSharetip').show()) {
        $('#BWGSharetip').animate({
            opacity: 0
        }, 30);
    }
});
function showMeTooltip() {
    var pageURL = window.location.toString();
    var twitterLink = "https://twitter.com/intent/tweet?text=" +  getTextToShare() + "&via=" + twitterAccount + "&url=" + pageURL;
    $('#BWGSharetip').show();
    $('#BWGSharetip').animate({
        opacity: 1
    }, 30);
    $('#sendToTwitter').attr('href', twitterLink);
}
function getTextToShare() {
    shareTxt = '';
    if (window.getSelection) {
        shareTxt = window.getSelection();
        generateTooltipPosition();
    } else if (document.getSelection) {
        shareTxt = document.getSelection();
        generateTooltipPosition();
    }
    return shareTxt;
}
function generateTooltipPosition() {
    var selection = window.getSelection && window.getSelection();
    if (selection && selection.rangeCount > 0) {
        range = selection.getRangeAt(0);
        pos = $(window).scrollTop();
        selection_text = selection.toString(), rect = range.getBoundingClientRect();
        $('#BWGSharetip').css({
            top: (rect.top + pos - 20) - 32 + 'px',
            left: rect.left + (rect.width / 2) + 'px',
        });
    }
}
/*]]>*/
</script> ]

Now final code is an HTML code which we need to add to show the widget. Just search for </body> tag and paste the following HTML code just above it.

[<script>var twitterAccount = "nitinmaheta";</script>
    <div class="BWGSharetip" id="BWGSharetip">
         <div class="tooltipContainer"><a id="sendToTwitter"  href="" class="sharingLink  twitter"><span></span></a></div>
     </div> 

Now save your template and you're done.

Drop your comments and questions below. 

COMMENTS

BLOGGER
Name

Ad Networks,4,Adsense,3,Adsense Alternative,2,Affiliate Marketing,3,ARTICLE WRITING,3,Aweber,1,BACKLINKING,1,Bitcoins,1,BLOG DESIGN,5,BLOGGER,19,BLOGGER NOTIFICATIONS,2,BLOGGER PLUGINS,23,BLOGGER POSTS,3,BLOGGER WIDGETS,16,Blogging,8,BLOGGING TIPS,28,Bluehost,1,Chitika,1,CHRISTMAS DECORATION,1,COMMENTS,2,Coupons,1,Email Marketing,2,FACEBOOK,3,Freelancing,1,GCS,1,Grammarly,1,help,1,How To,2,important points,1,JQUERY,2,Links,1,Make Money Online,14,NAVIGATION,1,New Year 2017,1,Nofollow Links,1,NOTIFICATIONS,1,online,2,Other,1,Outreach Emails,1,Parental control,1,POPULAR POSTS,1,Privacy,1,Review,5,RSS Feed,1,secure,1,seo,13,Shortcode,1,SOCIAL MEDIA,9,Start A Blog,3,Tech News,1,Tech Tips,2,TEMPLATE CUSTOMIZATION,15,Top Softwares,1,TRAFFIC TIPS,7,Web Hosting,2,WEBMASTER TOOLS,4,widgets,32,WordPress Plugins,1,WordzPress,1,WP THEMES,1,YouTube,2,
ltr
item
HV BLOGGERS: "SELECT TEXT AND SHARE IT ON TWITTER" WIDGET FOR BLOGGER
"SELECT TEXT AND SHARE IT ON TWITTER" WIDGET FOR BLOGGER
https://4.bp.blogspot.com/-3zKCjjip9aI/WHUJSPwRf_I/AAAAAAAABrQ/uh2PXdM44Hwq4htQRvXSMAW3wTUNJyNSQCLcB/s1600/Select-Text-to-Share.png
https://4.bp.blogspot.com/-3zKCjjip9aI/WHUJSPwRf_I/AAAAAAAABrQ/uh2PXdM44Hwq4htQRvXSMAW3wTUNJyNSQCLcB/s72-c/Select-Text-to-Share.png
HV BLOGGERS
https://hvbloggers.blogspot.com/2017/01/select-text-and-share-it-on-twitter.html
https://hvbloggers.blogspot.com/
https://hvbloggers.blogspot.com/
https://hvbloggers.blogspot.com/2017/01/select-text-and-share-it-on-twitter.html
true
4122661956596859215
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy