[How To] Optimize Auto SEO Image on Blog
Many blogger to competiting for get top rank google, like content writer, put breadcrumb and etc. But you have still less for SEO, one of each this image, yep image govern too. This post will share for seo auto optimation image on blog, this matter do this for image your blog auto indexed by search engine like google, bing, yandex etc. So you are not bothered with manual increase at description such as <image=”description your image” height=”50” src=”http://image.png” width=”25”/> when create this post.
This matter can troublesome until manual increase one by one image. Because image is way to get unique visitor or set off interface, next this step for create auto optimation SEO image;
Before put this code, first find </body> then copy paste this code above </body>
<script type=”text/javascript”>
//<![CDATA[
$(document).ready(function() {
$(‘img’).each(function(){
var $img = $(this);
var filename = $img.attr(‘src’)
$img.attr(‘alt’, filename.substring((filename.lastIndexOf(‘/’))+1, filename.lastIndexOf(‘.’)));
});
});
//]]>
</script>
<script type=”text/javascript”>
//<![CDATA[
$(document).ready(function() {
$(‘img’).each(function(){
var $img = $(this);
var filename = $img.attr(‘src’)
$img.attr(‘title’, filename.substring((filename.lastIndexOf(‘/’))+1, filename.lastIndexOf(‘.’)));
});
});
//]]>
</script>
<script type=”text/javascript”>
//<![CDATA[
var scrollTimer = null;
$(window).scroll(function() {
var viewportHeight = $(this).height(),
scrollbarHeight = viewportHeight / $(document).height() * viewportHeight,
progress = $(this).scrollTop() / ($(document).height() - viewportHeight),
distance = progress * (viewportHeight - scrollbarHeight) + scrollbarHeight / 2 - $(‘#scroll’).height() / 2;
$(‘#scroll’)
.css(‘top’, distance)
.text(‘ (‘ + Math.round(progress * 100) + ‘%)’)
.fadeIn(100);
if (scrollTimer !== null) {
clearTimeout(scrollTimer);
}
scrollTimer = setTimeout(function() {
$(‘#scroll’).fadeOut();
}, 1500);
});
//]]>
</script>
Next save template and get the benefits, so we no need insert manual description to image.
Thanks!