To usage the select too part twitter widget on blogger, you lot volition bring to add together to a greater extent than or less code to your blogger template to plough over the widget a skilful expect too alow it to know the text selected too redirect the user to to a greater extent than or less other page inward twitter where they tin glue the selected info. Am pretty certain you lot are instantly conversant amongst what nosotros are talking close inward this tutorial too if now, the motion-picture demo below shows how the widget volition expect similar apon implementing too selecting text inward your blogger blog.
How To Add Select And Share Twitter Widget inward Blogger.
To add together the part twitter widget to blogger you lot volition bring to follow the steps below too house the code indicated inward the appropriate expanse of use.Step 1. Log inward to Blogger too select your specific website to add together the SEO code.
Step 2. Reach out to the left commands past times navigating to them to the Template command
Step 3. Click on the template ascendance too therefore locate the Edit HTML side past times side to Customize.
Step 4. Click anywhere inward your code too therefore click on Ctrl+F inward windows or CMD+F inward mac.
Step 5. Search for ]]></b:skin>
Step 6. Just ABOVE the Above code, glue the CSS code below.
.seoclive {That's all amongst the CSS portion of the twitter select too part widget. That's the fashion of the twitter plane too background too select. Now, let's add together to a greater extent than or less fiddling javascript to spice things up.
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;
}
.seoclive bridge {
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;
}
.seoclive a {
color:#f16786;
}
.seoclive:hover {
background:#3D566E;
}
.seoclive:hover bridge {
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/AVvXsEhmcXxCCDTCgHxU95FcaAQexC3-oo8pjIbqkCmNgXm-t9qhIjGwkslTOBxPxpOXEYoB1j9It3_TSW_LoPnQiyP_kREkYcIcSHTwCVsRpjDEbtlEB67gaA1UkM6sXVSfMyClcd3FYmFSuEoU/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;
}
- Search for </head> too re-create too glue the below code only inward a higher house it.
<script type='text/javascript'>Now nosotros are in conclusion solely 1 pace to completion. We bring to add together the uncomplicated HTML code to brand the widget piece of job too nosotros volition move skilful to become now. Let's outpouring into the implementation setup process.
/*<![CDATA[*/
$(document).ready(function() {
textToShare = '';
$(document).mousemove(function(m) {
generateTooltipPosition();
});
});
$(document).mouseup(function() {
$(document).mousemove(function(m) {
generateTooltipPosition()
});
var textToShare = getTextToShare();
var seoclive = document.getElementById("seoclive");
if (textToShare != '') showMeTooltip();
});
$(document).click(function() {
var textToShare = getTextToShare();
var tooltipTitle = null;
var newTooltipTitle = $("#seoclive").attr("title");
if (newTooltipTitle == "") return;
if (newTooltipTitle !== tooltipTitle) $('#seoclive').animate({
opacity: 0
}, 30);
if (textToShare != "") showMeTooltip();
});
$(window).resize(function() {
if ($('#seoclive').show()) {
$('#seoclive').animate({
opacity: 0
}, 30);
}
});
function showMeTooltip() {
var pageURL = window.location.toString();
var twitterLink = "https://twitter.com/intent/tweet?text=" + getTextToShare() + "&via=" + twitterAccount + "&url=" + pageURL;
$('#seoclive').show();
$('#seoclive').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();
}
provide shareTxt;
}
function generateTooltipPosition() {
var alternative = window.getSelection && window.getSelection();
if (selection && selection.rangeCount > 0) {
make = selection.getRangeAt(0);
pos = $(window).scrollTop();
selection_text = selection.toString(), rect = range.getBoundingClientRect();
$('#seoclive').css({
top: (rect.top + pos - 20) - 32 + 'px',
left: rect.left + (rect.width / 2) + 'px',
});
}
}
/*]]>*/
</script>
- Search for the code </body> too glue the Below code inward a higher house it.
<script>var twitterAccount = "nitinmaheta";</script>Now you lot are done amongst the implementation of the widget too am pretty certain it volition piece of job good amongst a skilful UI that you lot volition honey experiencing inward your blogger blog. In illustration you lot require to a greater extent than assistance inward this, only holla me through the contact us page or comment too I volition move available for help. Thanks, sick notice you lot on the side past times side one. See the below reviews of the select too part twitter widget for blogger.
<div class="seoclive" id="seoclive">
<div class="tooltipContainer"><a id="sendToTwitter" href="" class="sharingLink twitter"><span></span></a></div>
</div>
0 komentar:
Please comment if there are any that need to be asked.