Showing posts with label jQuery. Show all posts
Showing posts with label jQuery. Show all posts

Sunday, 28 March 2010

Use jquery to style your external links with image

You must have noticed in Wikipedia that all external links is followed by an image basically this tells user that the link will open in a new tab.
Lets see an example -
Blogger -An external Link
Fun with blogger -Internal link


You have noticed that the hyperlink blogger has an arrow image on right of it! This tells the user that the link will open up in a new tab when being clicked!One way of doing this is manually putting the class name to each anchor tag entry having external target! or just use jquery function and let Jquery do it for you.

# Understanding External Links strategy.What are external links?
External links are those links which points away from  your site.For this  we use a special attribute target="_blank" which tells the browser to open external link in new tab or window.
External link Looks like this
<a href="http://www.blogger.com/" target="_blank">Blogger </a>
# Purpose/Use  of JQuery.We will use jQuery to find out all a tags with target="_blank" attribute and will append a class name "external" to them by easily defining css for class external.
# Add Class name "external" To your blogger.Just Edit your Template:
Blogger Dashboard >
Layout > Edit HTML

a.external {
padding-right: 13px;
background: transparent url("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja2_eiY3Lzo0VpSKWoPJ_eNV7VTDDQ66SIJKUU2oisjwnwoOXmdHusTL0rWh97x9LuM47BbCJzVQ7IrQm5rsfBc5grgrXW3mn82_EGI3ZxyASlQBfHqv00fUUOJXwRYp0O_PrIG6CHgIWk/s320/external.png") no-repeat scroll right center;
}

Now paste the above CSS code before ]]></b:skin>

#Append JQuery to your blogger.Copy below code and paste it Before the </head> in your template.
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script><script type="text/javascript">$(document).ready(function() {    $('a[target="_blank"]').addClass("external");});</script>

This javascript code consist of two parts:
Jquery library-
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
And a function which search  target="_blank" attribute and will append a class name "external" to it.

That was all regarding Using jquery to make your external links looks cool and different.Stay in touch with me bu subscribing to my posts with RSS And MAIL
Please  give your feedback and do share this article with your friends.

Monday, 15 February 2010

Google Buzz Widget -Display Your Buzz on webpages

You must have seen twitter API widget which displays your tweets on to your blog using JQuery.This Google buzz gadget works similarly by taking feeds from your google buzz and display on your web pages.
This widget is developed by moretechtips and is on google code.You can either download it from there and put in a direct way.

 This is a jQuery widget for the brand new social network -Google Buzz- that you can embed anywhere to integrate your buzz stream into your page.



You need to add following before </head> section.

<script type="text/javascript"  src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://google-buzz-widget.googlecode.com/files/jquery.google-buzz-1.0.min.js"></script>

First one is a jquery library and the second one is google buzz widget script.

And finally you have to add a javascript which calls various parameters from your google buzz widget javascript ,which is the second one from above two.

<script type="text/javascript">
   $(document).ready(function(){
      $('div.my-buzz').googleBuzz({
         username:'Your googleprofile name'
         ,n:4
         ,show_n:0
      });
   });
</script>

<div class="my-buzz">loading..</div>

Options and Modifications-

Your googleprofile name - Replace This with your own google profile name which is generally your gmail id.
n is the number of buzzes to read (maximum 100, default 10)
show_n is the maximum amount of buzz to display simultaneously (zero disables the transition effect and the default is 1)

Saturday, 23 January 2010

Animated jquery sharing bar with 360 revolution


Today i am sharing with you  an awesome animated sharing option (from Martin Angelov on tutorialzine) by using pure JavaScript with the jQuery framework.which will enable your website visitors to share posts on a number of social networks.Social networking place a very important role in the popularity of the blog,blogger that communicate better and understand the power of social media are generally the most popular ones.
Before we start you make also like to look at  some of my previous posts:Tiny facebook gadget (add to your blogger)Another social bookmarking using image swapping
Now,Installing it to the blogger below every post is like every other social bookmarking bar ,there is an Html with a css supporting it, on the top of it working the Jquery.




Copy this CSS code and paste it above  ]]></b:skin> in your template code ,no need to expand widget template.



For get this working we need to install these two JavaScript between head sections :
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ikb.fileave.com/rotating%20social.js"></script>
 
First one includes jquery library from google's CDN and the second one is rotating social file.
To show the code below every post paste this HTML code below <data:post.body/>
 

And save your template Click on view blog to see it working.

Wednesday, 6 January 2010

Make your widgets dragable - Feel Like MAC ♥


Drag and Drop Your widgets

No, this is not a  MAC's  review nor it is Upcoming Notebook promotion . This is a blogger trick which will let you and your readers to give MAC like effect to your blog.This will let you to drag and grop your widget box from one place to another.You just have to choose widgets name which you want to make dragable.


Lets see a    to see how its look like.Try To Drag and drop widgets from sidebar to any position on the screen
How to Do that for My blog ..??
Copy Below given code which include three JavaScript and paste it just above your</body>
Do not forgot to Expand your template.
Hint : Use your browser search( Ctrl + F ) to find </body>
Do not just copy Blindly read the full post first.

<script src='http://www.google.com/jsapi' type='text/javascript'></script>
<script type='text/javascript'>
google.load("jquery", "1.3.2");
google.load("jqueryui", "1.7.1");
</script>
<script type='text/javascript'>
$(document).ready(function(){
$(".widget.HTML").draggable();
$(".widget.Label").draggable();
$(".widget.BlogArchive").draggable();

});
</script>

Let me explain you about the code:
1st javascript block is to recieve Ajax library from google server.
2nd javascript block is to recieve Jquery library from google server.
3rd javascript ,i am specifing all widgets which i want to make dragable by calling dragable function of Jquery itself .

How to select widgets :
Selecting your widgets is easy,you have to get the name of your widgets as defined in your template code.

$(".widget.HTML").draggable(); will make your all HTML widgets dragable.
$(".widget.Label").draggable(); will make your Label widget dragable.
$(".widget.BlogArchive").draggable(); will make your BlogArchive widget dragable.

 What if you want your BlogArchive to remain stationary , just delete this line
$(".widget.BlogArchive").draggable();
from the above codeand you are done.

Do not forgot to save your template

I have tried to make this tutorial as explainatory as possible ,if you still feel any problem or want to  add your thoughts to it.Let me know through your comments will LUV to hear you.

Sunday, 15 November 2009

Add JQuery Color fading Menu to blogger


Need a Additional navigation Menu For your blog just try this one,a cool widget navigation using jQuery with Black-grey hovering effect.

Follow the Steps And the Navigation could be yours:
1.Login to your dashboard
2.navigate through Layout->Edit HTML
3.Search for </head>  and add the below given code above </head>.
 

4.Click on Save Template
Note:I suggest you to host images yourself.

5.Now go to layout -> page element  and Click on Add a .Gadget and choose Html/javascript From the popup.

6.Now Add the below given Html modifying according to your need
<a class="hoverBtn" href="#">Home</a>
<a class="hoverBtn" href="#">HTML</a>
<a class="hoverBtn" href="#">CSS</a>
<a class="hoverBtn" href="#">About</a>
<a class="hoverBtn" href="#">Contact</a>

Just Reply back..!! to say thanks...OR you have any problem with this tricks..