Archive for September, 2010

Simple jQuery accordion to show News, Faq, Questions and Answers

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

jQuery accordion allows us to show the content of the selected header.  Its feature is that only the content of the selected header can be open at once. So it’s useful in showing the news content with header or Frequently asked questions regarding some topic or Questions and Answers etc.

The CSS used:

<style type="text/css">
#accordion { width:700px; margin: 0; padding: 0; }
#accordion p span { cursor:pointer; }
 
.news-title{
	color:#1e6e86;
	font: bold 12px Arial;
	margin-bottom:10px;
	background:#EDEDED;
	padding:5px 10px;
	}
.news_text{
	margin-left:10px;
	line-height:18px;
	}
</style>

jQuery script used:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
 
<script type="text/javascript">
$(document).ready(function($) {
       $('#accordion div').hide();
       $('#accordion p span').click(function(){
               $('#accordion div').slideUp();
               $(this).parent().next().slideDown();
               return false;
       });
});
</script>

Convert video to mp3 from various video sharing websites like YouTube

Although there are many more online video to mp3 converters, but these are easy and most commonly used.

1. www.video2mp3.net

video2mp3

Video2mp3 is a free YouTube, MyVideo, Clipfish, Sevenload, Dailymotion, MySpace to MP3 Converter and allows you to convert and download  a video to MP3 file online. This service is fast, free, and requires no signup. All you need is a Video URL, and our software will transfer the video to our server, extract the MP3, and give you a link to download the audio file. So you are able to listen to your favorite YouTube tracks on every MP3 player.

Use other javascript library with jQuery using jQuery.noConflict

We all know that many javascript libraries like Prototype, MooTools etc. use  $ as a function or variable name and jQuery uses the same.

But in the jQuery $ is just the alias name for “jQuery” and hence we can get all the functionality without the use of $. There by it facilitates us to use other library along with it.

So for this we will override jQuery’s default $ name by calling jQuery.noConflict()

If you are including other library file first then jQuery file then call the function before other library gets used.

Sample format:

Analyze the performance of your website using GTmetrix

“Fast is better than slow.”

It’s one of the ten philosophies that Google have. More

So everybody deserves a fast web experience.

GTmetrix can help us develop a faster, more efficient, and all-around improved website experience for our users.

Studies show that users leave a site if it hasn’t loaded in 4 seconds; keep your users happy and engaged by providing a fast performing website!

GTmetrix uses Google Page Speed and Yahoo! YSlow to grade your site’s performance and provides actionable recommendations to fix these issues.

GTmetrix

Powered by WordPress

Page optimized by WP Minify WordPress Plugin