Some thing that I like

Like usual, we all love to hang out with friends in the night to have some chit chat hour (I know, it sad my wife can’t do it at the moment). Not because we want to compare our life or talking about the side effects of diet pills and blah blah blah… But to communicate like we wanted and do what we like.

Coffee shop

As usual, I went to a lot of coffee shop lately. Most of my friends coming back from all around the World for Chinese New Year festival. But one thing I like the most was to talk about politic in Malaysia. I don’t know since when I addicted to politic, maybe Malaysia Today did so…

My wife on the other hand, she don’t like politic talk at all. She would prefer to mind her own business, as long as the political game doesn’t touch her :? Well, let’s just say, I need to calm down too :)

Digg it StumbleUpon del.icio.us

A 6 lines Javascript for 3 effects

Been around JQuery and find some interesting usage of it and compress it as much as I can. Most webmaster looking for a way to compress as much size as possible to make a website load fast.

Javascript example

Dropdown menu script is one of my most used Javascript. In order to make really useful of it, I then make a small experiement on it and see how it goes. The 6 lines saved a lot of size and my time for looking for more Javascript. This is much more safer than safe weight loss pills.

Demo

$(function () {
$(‘CLASS‘).hover(
function () {$(‘CLASS‘, this).slideDown(100);},
function () {$(‘CLASS‘, this).slideUp(100);
});
});

These are the 6 lines I’m going to use to make 3 effects, dropdown, tooltip and a slide.

Let’s make a basic drop down menu, hiding the second-level menu.

Dropdown menu

#menu {
height: 30px;
list-style: none;
}
#menu li {
float: left;
position; relative;
padding: 2px 10px;
}
#menu li ul {
display: none;
list-style: none;
position: absolute;
background: #efefef;
width: 200px;
z-index: 1;
}
#menu li ul li {
clear: both;
display: block;
}

Now we are going to call the second-level menu (ul) with the Javascript.

$(function () {
$(‘#menu li‘).hover(
function () {$(‘ul‘, this).slideDown(100);},
function () {$(‘ul‘, this).slideUp(100);
});
});

Continue with the second effect, which will be using the same 6 lines of Javascript – The tooltip.

Tooltip

a.tooltip {
position: relative;
}
a.tooltip span {
display: none;
position: absolute;
top: 20px;
padding: 10px;
background: #ccc;
}

I hided the span so it will only comes out when hover the link (a)

$(function () {
$(‘#menu li, a.tooltip‘).hover(
function () {$(‘ul, span‘, this).slideDown(100);},
function () {$(‘ul, span‘, this).slideUp(100);
});
});

Now I have this 6 lines work on both effect. Going for the third one, the slide :) Since I use the same 6 line Javascript, I keep on the span, so I don’t need to add more line on the function.

Slide

#slide {
position: relative;
width: 300px;
}
#slide .none {
display: block;
}
#slide span.thumb {
display: block;
width: 175px;
padding: 13px 0px;
background: #eee;
cursor: pointer;
}
#slide span.thumb span {
position: absolute;
right: 0px;
top: 0px;
display: none;
z-index: 1;
}

Because I use the same class (span), so I don’t need to add more into the Javascipt. Only the .thumb class.

$(function () {
$(‘#menu li, a.tooltip, .thumb‘).hover(
function () {$(‘ul, span‘, this).slideDown(100);},
function () {$(‘ul, span‘, this).slideUp(100);
});
});

These 6 lines will work on 3 effects on the same page or not. So it dramatically compressed the size of one website.

Demo

Digg it StumbleUpon del.icio.us

Decision and sickness

I’m feeling a bit of sickness now. Some of my friends are sick, coughing, fever, flu and all the rest. It come on Chinese New Year, what a day eh? We all need some men’s vitamins for the next Chinese New Year. All those junk food are bitches!

Anyway, went to the JPN for the final time…

Registered

Coming home with a more legal wife :lol:

So I have some draft on my mind. Haven’t really have the time to write everything down. The holidays has been keeping me lazy and sleepy all the time! Lucky I’m not with any office right now, or I will really sleep in the office for the next few days to adjust my body time zone.

An idea pop up my mind all of sudden the other night. Should I move to Puchong again, or should I really stays in Sibu and lay low? The first motive is to get my master in KL and study part time while working like how I work now. And hey, I might even get some more connection than now, who knows? Even though my wife and I normally getting job from email and some phones and none of those request made from Sibu at all. Sibu is like a location for us to work. Staying in KL we can fly to Medan or Sibu with one flight instead of two.

Well, the last choice at the moment is to stays in Sibu. Don’t make any move until we being push to :)

Digg it StumbleUpon del.icio.us

Back to normal

This is the fourth day of Chinese New Year. A lot has get back to work and starting a normal life, like me too. My wife and I has been working since day 1 :(

Chinese New Year decoration

Anyway, what Chinese New Year means is gathering, it’s not getting drunk or holidays or any sort. Even though I cannot tell that this Chinese New Year has been a great one, but at least everybody came back home just for today.

Chinese New Year junk food

Another thing about Chinese New Year is the junk food. You get it everywhere on every house you visited. I am seriously in need of some fat burners product for these few days. I believe most people getting 1kg to 3 kg this 3 days alone.

Keep well and have fun… Let’s work the head off like usual again :)

Digg it StumbleUpon del.icio.us

Wedding in the year of Tiger?

Some Chinese taboo stated that wedding in the year of Tiger is not good, for some reason I don’t understand at all. Wonder why my wedding from planning to finishing took only 3 months? Not because the pregnant timing, but the year timing, some people do have the belief.

Arriving bride's house

But whatever reason it was, third day (yesterday) was a wedding day of my friend :) It was the morning, which is the time that I hate the most in a day. We arrived the bride’s house at around 8.40am and had some fun yet embarrassing moment for a while.

Brotherhood

We were ordered to wear some paper underwear written with words and sing a song as loud as possible. I’m not sure how the neighborhood felt but it’s still a little fun in there. Well, this is a great way to test a friend, maybe? Or perhaps to heat up the topic on the wedding dinner which happen mostly at night.

Church

After all those fun at the bride’s house, we went to church to witness the couple become one :) Bible quoted:

“So they are no longer two but one flesh. Therefore what God has joined together, no human being must separate.”

Mark 10:8-9

Wedding dinner

Happy wedding for the couple :)

As for me, the third months of wedding really makes a lot of ear pulling. Gonna get use to it…

Digg it StumbleUpon del.icio.us
 Page 4 of 204  « First  ... « 2  3  4  5  6 » ...  Last »