It's common to create a "mask" layer on top of the page in order to display photos, pop-up messages, etc.I used to use the "absolute" positioning to do the job under I lately discovered the so called "masked" will move if there is a scroll bar (when shrinking the window's size).This problem can be easily solved by just setting the DIV to "fixed" position.Another problem solved! But wait a minute. This solution doesn't work in IE! Let me see if there is a workaround for this...
Tuesday, April 5, 2016
Best Way to Round Up Numbers Using Javascript
I previously found several solutions to round up (float) numbers to closest two decimal places. Some are using complicated function with sofisticated codes but I find this one-liner quite effective and efficient:Math.round(num*100)/100; // for two decimal placesMath.round(num*1000)/1000; // for three decimal places..I appreciate the author who did this and sorry for forgetting where I get it from....
Wednesday, March 16, 2016
Login with Facebook using PHP with v5 SDK

It has been a long time since my last post about Facebook. Many things have changed since. This time I want to talk about the new version of Login PHP SDK for Facebook.
The latest version of SDK can be found here.
I think I can skip to codes directly as all the steps to install the SDK and obtain the app_id and app_secret can be easily found in the internet. But I need to point out the errors...
Monday, March 7, 2016
Limit a DIV to Certain Scroll Height with Javascript

This is very popular nowadays. You can see major websites around the internet are having this feature. Why? Important information
will not get left out if the web page is scrolled down a lot. This can improve the navigation experience of the website substantially. So how is it
done? You may need to know how to fix a DIV before you can fully understand this post. Here are some of my earlier posts...
Wednesday, February 24, 2016
Good Looking HTML Table Style

Creating a good looking HTML table sounds easy but when it comes to actual execution, it is not as easy as it seems. Consider the following
most basic HTML textbook codes for a 3x3 HTML table:
<table border=1>
<tr><td>Apple</td><td>Book</td><td>Car</td></tr>
<tr><td>1</td><td>2</td><td>3</td></tr>
<tr><td>4</td><td>5</td><td>6</td></tr>
</table>
Here...
Subscribe to:
Posts (Atom)