This cool jQuery Spinning Pages or Links Widget For Blogger. This widget is a mixture of jQuery And Css. This widget has a spinning effect. The pages or links mentioned spin and on hover go on slowing down and the stop. This widget is easy to put so have it in your blog.
Demo
<div id="link">
<ul>
<li><a href="#">Ajax</a></li>
<li><a href="#">Css</a></li>
<li><a href="#">Design</a></li>
<li><a href="#">Firefox</a></li>
<li><a href="#">Flash</a></li>
<li><a href="#">Html</a></li>
<li><a href="#">Chrome</a></li>
<li><a href="#">jquery</a></li>
<li><a href="#">PHP</a></li>
<li><a href="#">SEO</a></li>
<li><a href="#">Page</a></li>
<li><a href="#">Safari</a></li>
<li><a href="#">Web</a></li>
<li><a href="http://blog-toolz.blogspot.com/">Add This</a></li>
</ul>
</div>
Steps To Add Spinning Links Widget
- Login to your Dashboard.
- Go to Templates >>Edit Html.
- Find for <head> tag.
- Paste the below below the <head> tag.
<style media='screen' type='text/css'>
#link{
margin:0 auto;
height:200px;
width:200px;
overflow:hidden;
position:relative;
background:transparent;}
#link ul,
#link li{
link-style:none;
margin:0;
padding:0;}
#link a{
position:absolute;
text-decoration: none;
color:#666;
font-size:20px;}
#link a:hover{
color:#ccc;}
</style>
<script charset='utf-8' src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function(){
var element = $('#link a');
var offset = 0;
var stepping = 0.02;
var link = $('#link');
var $link = $(link)
$link.mousemove(function(e){
var topOfLink = $link.eq(0).offset().top
var linkHeight = $link.height()
stepping = (e.clientY - topOfLink) / linkHeight * 0.2 - 0.1;
});
for (var i = element.length - 1; i >= 0; i--)
{
element[i].elemAngle = i * Math.PI * 2 / element.length;
}
setInterval(render, 20);
function render(){
for (var i = element.length - 1; i >= 0; i--){
var angle = element[i].elemAngle + offset;
x = 120 + Math.sin(angle) * 30;
y = 45 + Math.cos(angle) * 40;
size = Math.round(40 - Math.sin(angle) * 40);
var elementCenter = $(element[i]).width() / 2;
var leftValue = (($link.width()/2) * x / 100 - elementCenter) + "px"
$(element[i]).css("opacity",size/100);
$(element[i]).css("zIndex" ,size);
$(element[i]).css("left" ,leftValue);
$(element[i]).css("top", y + "%");
}
offset += stepping;
}
});
</script>
#link{
margin:0 auto;
height:200px;
width:200px;
overflow:hidden;
position:relative;
background:transparent;}
#link ul,
#link li{
link-style:none;
margin:0;
padding:0;}
#link a{
position:absolute;
text-decoration: none;
color:#666;
font-size:20px;}
#link a:hover{
color:#ccc;}
</style>
<script charset='utf-8' src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function(){
var element = $('#link a');
var offset = 0;
var stepping = 0.02;
var link = $('#link');
var $link = $(link)
$link.mousemove(function(e){
var topOfLink = $link.eq(0).offset().top
var linkHeight = $link.height()
stepping = (e.clientY - topOfLink) / linkHeight * 0.2 - 0.1;
});
for (var i = element.length - 1; i >= 0; i--)
{
element[i].elemAngle = i * Math.PI * 2 / element.length;
}
setInterval(render, 20);
function render(){
for (var i = element.length - 1; i >= 0; i--){
var angle = element[i].elemAngle + offset;
x = 120 + Math.sin(angle) * 30;
y = 45 + Math.cos(angle) * 40;
size = Math.round(40 - Math.sin(angle) * 40);
var elementCenter = $(element[i]).width() / 2;
var leftValue = (($link.width()/2) * x / 100 - elementCenter) + "px"
$(element[i]).css("opacity",size/100);
$(element[i]).css("zIndex" ,size);
$(element[i]).css("left" ,leftValue);
$(element[i]).css("top", y + "%");
}
offset += stepping;
}
});
</script>
- Now, go to Layout.
- Add a Gadget >> Html/Javascript.
- Paste the below code there.
<div id="link">
<ul>
<li><a href="#">Ajax</a></li>
<li><a href="#">Css</a></li>
<li><a href="#">Design</a></li>
<li><a href="#">Firefox</a></li>
<li><a href="#">Flash</a></li>
<li><a href="#">Html</a></li>
<li><a href="#">Chrome</a></li>
<li><a href="#">jquery</a></li>
<li><a href="#">PHP</a></li>
<li><a href="#">SEO</a></li>
<li><a href="#">Page</a></li>
<li><a href="#">Safari</a></li>
<li><a href="#">Web</a></li>
<li><a href="http://blog-toolz.blogspot.com/">Add This</a></li>
</ul>
</div>
- Now, click on Save and Enjoy the widget.
It's Done.
Categories:
Blogger Widgets
,
CSS
,
jQuery
0 comments:
Post a Comment