Simple FAQs with jQuery

There are lot of such FAQs toggle scripts available and you will be asking why I wrote a new one. The reason is simple to make the script work with different and most used html structures. Most of the time user will be entering data from CMS and we have to make the script working with that. This script is customized to work with content management system so any HTML header tag(h1 -h6) followed by a content tag will do . Any bugs please report ;) .

Code :

jQuery.fn.faqs=function(options) {
var settings = {showFirst:true,activeClass:'opened'};
if(options) {jQuery.extend(settings, options);}
	$(this).each(function() {
	var cObj=this;
	$(this).find(":header").not(this).next("*:not(:header)").hide();
	if(settings.showFirst) {
	$(this).find(":header:first").addClass(settings.activeClass).not(this).next("*:not(:header)").show();
	} 
	$(this).find(":header").click(function(e) {
	$(this).toggleClass(settings.activeClass).next("*:not(:header)").toggle(':animated');
	$(this).parents().filter(cObj).find(":header").not(this).next("*:not(:header)").hide().prev(":header").removeClass(settings.activeClass);
 	});
	});
}

How to call ?

$(function() {
$(".faq1, .faq2, .faq3").faqs({showFirst:true,activeClass:'active'});
});

No Comments

Thickbox(3.1) image group not working with latest jQuery? Try this

Today one of my colleague faced an issue with Thickbox. He was using “rel” tag to group images and show in gallery. Code was working fine but suddenly it stopped working after updating the jQuery library to latest version(1.4). After lot of debugging we found the issue. Below line throws an exception
“unrecognized expression: “.

 TB_TempArray = $("a[@rel="+imageGroup+"]").get();

Issue was with “@” selector which was not supported in latest jQuery. We had replaced it and finally got the code working.

TB_TempArray = $("a[rel="+imageGroup+"]").get();

Hope this may help someone :)

,

2 Comments

Flip Media unveils the Unofficial Dubai Metro website

Dubai–With residents eagerly awaiting the launch of the Dubai Metro, Dubai’s biggest infrastructure project, Flip Media today unveiled Mydubaimetro.com, a non profit portal designed and developed to provide residents of Dubai with a practical and usable guide to all things related to the Metro.

The one stop shop website offers key information and helpful tools such as a journey planner and fare calculator, information about each station stop as well as downloadable pocket maps.

“We saw a gap in the market where people, including ourselves, were curious and hungry for more information about the Metro,” said Yousef Tuqan Tuqan, CEO, Flip Media.

Dinesh Lalvani, Managing Partner of Flip added, “We’re bringing the best of web and technology to help people discover not only the basic information about the services available, but also help connect with fellow commuters. The idea is to make the metro not just about the destination but also about the journey and experience.”

The community portal gives users to post comments, blog and share photos and useful tips about the metro. The website is scalable, allowing for the addition of new technology and tools.

http://www.mydubaimetro.com/en

Source: Flip Media, flipcorp.com

No Comments

Enabling surround sound on Ubuntu 9.04

By default ubuntu 9.04 uses PulseAudio which use only 2 channels by default. I am using creative 4.1 speaker system . After installing Ubuntu I realized that only 2 speakers are working . After some googling I enabled the surround sound.

You can find the default configuration in /etc/pulse/daemon.conf.

sudo gedit /etc/pulse/daemon.conf

You can find a commented line ;default-sample-channels=2 in daemon.conf. Uncomment this line(remove ; ) and change this according to your surround system . For me its 4.1 so my entry is like below

 default-sample-channels = 5

If it is 5.1 then entry should be like default-sample-channels= 6

You have to restart pulseaudio( kill the pulseaudio and run it again from run dialog) or restart your machine.

,

1 Comment

Moved to Ubuntu 9.04 from windows XP

I am using windows XP since 2003. Last week I got an error and unfortunately it was XP Blue Screen of Death STOP Codes. The error i got was something like ” make sure you have enough disk space” and it looks so funny because I have 120 GB free space :) . Then i decided to move on to open source OS may be I am late but still ok.

Installed Ubuntu 9.04 and without any trouble Ubuntu auto configured almost all my devices. Had some problem in configuring BSNL broad band which i solved yesterday :)

,

1 Comment

Configured BSNL broad band in Ubuntu 9.04

Last couple of days I was trying to connect BSNL broadband in Ubuntu. I followed the instructions from ubuntu forums but all in vain. Finally I manually added the router ip address and gateway in /etc/network/interfaces and it started working :)

I had edited /etc/network/interfaces

sudo vi /etc/network/interfaces

and added below lines

iface eth0 inet static
 
	address 192.168.1.2
 
	netmask 255.255.255.0
 
	gateway 192.168.1.1

Hope this may help someone. Move to Ubuntu, it is super cool :)

,

2 Comments

Unable to create directory WP 2.7. 1

Today one of my colleague Praveen had an issue with image upload in wordpress. His site was hosted with my account. The error he getting was “Unable to create directory - Is its parent directory writable by the server?” . I had changed the permission to 777 and still the upload was not working. After lot of googling we found a solution . We changed the settings for “Uploading Files” in Settings->Miscellaneous Settings. We set “Full URL path to files “ using the the full URL path.

Check the screen shot below:
image_upload1

1 Comment

jQuery height function not working in thickbox iFramed content? try this

Last week we were trying to run a scroll script (DYN-WEB’s scrolling code ) inside thickbox iFramed content. Unfortunately code was not working and the reason was the element height not working. We tried alternative jQuery element height and the result was same. The height we were getting was ‘0′.

Finally we fixed this issue by using setTimeout and calling the scroll script after a small delay.

 $(function() {
    	alert($(".box").height()); // not working, what we got was '0'
    	setTimeout('alert($(".box").height());',500); // worked
 
  })

Hope this may help someone :)

,

2 Comments

Amazing cartoon by Jithin

Jithin a flash animator from Flip Media drawn a nice carton of Arun and me. Hmm he made me thinner again.  I am trying to get fatter but these guys are not allowing me to become fatter not even in cartoon.

amazing cartoon by Jithin

,

1 Comment

Firefox add-on Panic

Do you have fear of boss catching you while you are on YouTube?
Get rid of it, now there is add-on called panic which will allows you to close all your opened tabs and opens a new page which you can choose from settings :) . Also there is a key combination to restore the closed tabs.


https://addons.mozilla.org/en-US/firefox/addon/6367

Funny right? Never try to fool your boss :)

,

No Comments