Name Mon Lu

Love jQuery/CSS

Blog about Webdev

Twitter supawaza

RSS Twitter Flickr

What I am up to:


Author Archive

I love Zim­plit’s sim­ple idea, and rel­a­tively easy to setup (depend­ing on server’s con­fig­u­ra­tions). But of course it comes with a head-scratcher. Here are what I learned:

1. Local­host Time­out Error

As many sane devel­oper would do, you want to test almost every­thing on a Local server if you’re using Xampp Lite. I have been expe­ri­enc­ing time­out error. Maybe it’s due to the fire­wall at work, but I am going to inves­ti­gate more using a full veri­son of the Xampp server

2. “public_html” vs “www” Folders

This may sounds crazy, but I think it might have some­thing to do with the con­fig­u­ra­tions of the server. I tried upload­ing to my own server, every­thing works fine. But I couldn’t get it work­ing on my client’s server, it couldn’t CHMOD prop­erly. Crazy enough, I deleted every­thing and re-uploaded every­thing to the public_html folder, CHMOD the proper files, then it worked… I know both fold­ers are basi­cally the same thing, but why it hap­pened the way it did, CRAZY! I tell you. So I’m going to try to repro­duce this “bug” if it is even a bug or just me…

3. jQuery + zim­plit = Site Explosion!

Unfor­tu­nately, today I found out zim­plit will blow up your some parts of your lay­out if you have some sorts of script­ing going on in the back­ground, such as slideshow, hid­den divs. As soon as you insert an editable area, it auto­mat­i­cally inserts its own div and classes inside ALL OF YOUR DIVs! Drove me insane for over an hour why my sim­ple page stopped work­ing with a sim­ple slideshow. I mean it’s not the end of the world, you just have to rework your CSS to fit it in. But it would be nice IF SOMEONE TOLD ME BEFOREHAND!!

Over­all, zim­plit is still an awe­some idea, but it’s quite intru­sive. It works well if you have a very sim­ple web­site or planned ahead to use it at the begin­ning. If you decide to imple­ment after­ward, it is much more dif­fi­cult because you’ll prob­a­bly have to rework lots of CSS. But I think I will try my hands on it again next time when I build a site from scratch.  Just my 2 cents.

Equus 2010 Homepage

I finally launched the never-ending home­page redesign project yes­ter­day for my com­pany, so far so good, not every­thing I want, but at least got what my bosses want. I didn’t like the way how it was put together, but I had fun script­ing with jQuery once again. This time, he wants to do “wipe up” sort of effects and he resisted that me HTML-ing the hid­den con­tents because he wants it “the way it is” for the con­tents. *dies* So I’m stuck with image maps… the load­ing time on the page is “glo­ri­ous” to say the least… hey… I do what I asked of me. He didn’t want to hear load­ing time, the web stan­dards, best prac­tices, and stuff like that. Although, I added the help­ful image pre­loader plu­gin to speed things up just a bit, bet­ter than noth­ing. Over the course of the project, I’ve learned some lit­tle inter­est­ing things…

Inter­est­ing things I’ve learned…

  1. If you add “padding” around an image that has “hotspots” over it; IE (no mat­ter what ver­sion) WILL off­set the coor­di­nates by the padding – the “hotspots” will be off by the amount of padding you put around the image. But in Fire­fox, the image map hotspots behave the way it should be. So if you need to adjust the spac­ing of the images when using image maps, use “mar­gins”, don’t use “padding”. Took me a short while to fig­ure this out…
  2. Rel­a­tive + absolute posi­tions will snap pic­tures in any cor­ner you want. In my case, I wanted the image to be lower left cor­ner to achieve the “wip­ing” effect – oth­er­wise, it’ll just “slide” the image out if you don’t absolute posi­tion it.
      	<div style="position:relative">
        	<div style="position: absolute; bottom: 0; left: 0;">Image here</div>
        </div>
  3. Too many image map hotspots is like Fred­die Cougar’s face… ugly as hell and a freak­ing nightmare
  4. jQuery $.each() saved pounds of my hair once again
  5. Do not add neg­a­tive padding inside a jQuery.animate() – it will crash like a 100 cars pile-up on a highway…
  6. Don’t try to explain to my boss why adding more image hotspots inside an image map is such a bad idea – he looks at me funny and starts get­ting pissy

Besides all the pain and suf­fer­ing for a month, the most fun I got out of this project was script­ing the ani­ma­tions and solv­ing the “image map within an image map” prob­lem. Here’s the run-down of the project:

  1. There will be main menu at the bot­tom of the screen, when the user hov­ers over each of time, the cor­re­spond­ing con­tent (the image) will “wipe up” – I am call­ing this Tier 1 menu
    1. Now “wip­ing” and “slid­ing” are two dif­fer­ent ani­mals, and my mini-boss specif­i­cally wants “wip­ing”, not “slid­ing”. So I had quite a bit of fun try­ing to make the image con­tents “wipe” up
    2. Solu­tion: cre­ate a “wrap­per” div that wraps all the hid­den “con­tent images” – default the “wrap­per” to 0px, then use jQuery to ani­mate the height of the “Wrap­per” to the full height when hover over. So I basi­cally cre­ated a “mask” to do this hide the images. Attach the cor­re­spond­ing image, show, then “wipe” up
  2. Each of those image will have image map hotspots (no prob­lem here)
  3. Within Tier 1 menu’s con­tents, one of the con­tents has mul­ti­ple links within it and has a Tier 2 menu – bet­ter yet, the Tier 2 menu has four sub-contents WITH DIFFERENT unique image maps…

The Prob­lem

The prob­lem? If you use the same map for all the images, they will have other hotspots show­ing up in images that you don’t want. Let’s say Image A is using #map1, Image B needs to have the same menu but has dif­fer­ent hotspot links. When Image B uses #map1 again, well, all the hotspots intended for Image A will also shows up. Of course, the obvi­ous solu­tion is to have mul­ti­ple maps. The prob­lem is the Tier 2 Menu shows/hides its con­tents. So if you have mul­ti­ple maps, the Tier 2 Menu won’t able to hide and show con­tent accord­ingly unless you want to code each of the Tier 2 menu with its own lit­tle script. Repet­i­tive, inef­fi­cient, and prob­a­bly won’t work.

The Solution(s)

After los­ing a cou­ple hun­dreds of my hair, the solu­tion? Cre­ate sep­a­rate image maps for each of the unique hotspots map. So Image A gets its own map, Image B etc… use jQuery to clone the map accord­ing to the active menu and attach to the the “main map” (#map1), add a tem­po­rary class, and then remove them when the user hov­ers over a dif­fer­ent menu item. Mean­ing: #map1 is the Tier 2 main menu and is defaulted to Image A. #map1 has the Tier 2 main menu, and the rest has its own unique hotspots maps with­out the Tier 2 Menu. Let’s say Image C has unique hotspot links, so when the user hov­ers over Image C. jQuery will tell this Image C to append #map3 hotspots (<area>) to #map1. When the user hov­ers to a dif­fer­ent one, it removes all the pre­vi­ously attached “hotspots” – I iden­ti­fied them by adding a dummy class in each of the attached <area> map, then append another set if needed. Painful, but not bad for a workaround I think.

I find front-end devel­op­ment is like solv­ing puz­zles, and I love solv­ing puz­zles espe­cially when it involves jQuery. Well, that’s it folks.

Haven’t wrote any­thing for a while, but here’s some food for ran­dom thoughts. With all the newest and great­est hit­ting web namely CSS3 and HTML5, how about giv­ing some love and thoughts to Multi-touch as the next big thing on the web, and prob­a­bly will be Web 3.0? Now you would say some­thing like, “Well, you know Mac­books have that awe­some fea­ture and peo­ple ARE using it on web­sites.” Well, can YOUR web­sites sup­port flip­ping objects around with 2 fin­gers? An inter­face to crop and edit pho­tos using your 2 fingers/hands on your web­site / web app? iPhone / Android phones can, but on web­sites? Nope.

First of all, I am one of those peo­ple who refused to support/buy any­thing with an “i” in front of it, it’s not that one day I wake up and decided to dis­like Macs. I owned an iPod before and I found myself almost throw­ing it against the wall. I have used Macs, and I can’t find myself lik­ing it as much as a PC. Don’t get me wrong, I don’t hate it, but I just pre­fer PC’s… that being said, the best thing Apple “invented” and poured so much thoughts into my brain is the lat­est and great­est the Multi-touch technology.

Where did I get the idea Multi-touch will be Web 3.0? Well, Javascript libraries such as jQuery, Mootools, Pro­to­type etc… changed the way peo­ple inter­act with web, and how it deliv­ered inter­ac­tiv­ity and infor­ma­tion to the users. Designers/developers don’t need to depend on Flash/Silverlight to have ani­ma­tions / effects, things load faster in the back­ground or don’t even have to reload a page thanks to AJAX. No longer the user has to open a new win­dow to see a pic­ture, instead, they can see them using a Light­box or sim­i­lar tool. I per­son­ally feel those are the most impor­tant ele­ments that dif­fer­en­ti­ate the good old web from Web 2.0. Some might argue Web 2.0 is all about the shiny graph­ics, but I beg to be dif­fered. Not only that, Multi-touch is already in smart phones and Apple already started it with their Mac­books / Magic Mouse, and Win­dows 7 with their own multi-touch inter­face. It’s only a mat­ter of time when all the web­sites don’t require a mouse to browse and adding more inter­ac­tiv­i­ties, because I don’t have to use a mouse to browse when I use my G1, why should a desk­top com­puter? The tools are already existed to get us there, the ques­tion is how soon. My guess? I’d say in a year.

To prove it, some cra­zies already made one of the world’s first Multi-touch web­site tak­ing advan­tage of Win­dows 7 multi-touch sup­port – of course it still works if you don’t have a fancy multi-touch screen or a Wac­com Bam­boo Touch (cost only $69 and works on both Macs and PCs – yes, even Win XP SP2).  Or a fancy Mac­book / Magic Mouse.

Silverpac Multi-Touch

Although, I don’t think I’ll trade my CSS/HTML skills for multi-touch mak­ing web­sites in Sil­verlight. That being said, I think I was look­ing at the future of the web and prob­a­bly some­thing that will “encour­age” CSS3.x / and HTML4.x to sup­port multi-touch sooner, max­i­mize and push the web even fur­ther? Can I already say Multi-Touch Web 3.0, anyone?

A slight prob­lem of course Multi-touch is quite new, not many peo­ple have the tools to inter­act, or the neces­sity for it for the web at least. Never mind that, not a lot of peo­ple get the use of it. Multi-touch took me a few sec­onds to fig­ure out how to use it, now that I know, “wowser” is the word I’m using to describe it. To me, the web is all about two words: infor­ma­tion and expe­ri­ence. As designers/developers are con­stantly find­ing bet­ter and cooler way to cre­ate web­sites and deliver infor­ma­tion, Mutli-touch is def­i­nitely the next big thing on the web.

I don’t know about you, but I’m jump­ing on the band­wagon to look for a way to “fake” a Web 2.5 for now and make Web 2.0 sounds so 2008 while peo­ple still dig­ging the glossy/shiny but­tons, and debate the best way to clear floats.

You know… it’s prob­a­bly a silly real­iza­tion… but I’ve always copy & pasted vec­tor shape from Illus­tra­tor to Pho­to­shop, never the other way around. Today, I had to con­vert a shape that I wanted to use from Pho­to­shop to Illus­tra­tor (CS4 by the way), I was so sick of trac­ing it. I mean what’s the worst thing could hap­pened if I pasted some­thing a vec­tor shape from Pho­to­shop to Illus­tra­tor, right? Get an error some­thing, but to my sur­prise, it gives me a dia­logue ask­ing me whether I want to con­vert it to an Com­pound Shape or Path…

psd_paste_to_ai

…son of a… learn some­thing new every­day, don’t we now…? A lit­tle less deprived

I finally gath­ered my brain­cells and launched my new port­fo­lio: Designloper.com today:

Designloper.com

I was try­ing to “brand” myself in a way, what’s bet­ter than a made-up word that describes per­fectly of what I do, right?  I love the lime green col­ors, but I thought it was get­ting too bor­ing with the light gray and white.

mludesign

So I spiced things up this time with dark brown and hot pink.  I was lov­ing the fun col­ors as I was design­ing, it looked almost “hippy” which fits my per­son­al­i­ties – I never did drugs in my life, but I seem so… (more…)

Ver­sion in this arti­cle: jQuery 1.3.2 / CSV2Table 0.03-b-2.9

Lately I started to like CSV (Com­mon Sep­a­rated Val­ues) more and more com­par­ing to XML.XML is a pain to setup even as enter­ing data, then grab­bing the data requires Einstein’s brain plus 3 sleep­less and hair-pulling days of cod­ing… okay, I maybe exag­ger­ated a bit, but that’s how I feel about XML. My first encounter with CSV was InDe­sign, in there, you can import a bunch of data and gen­er­ates PDF like Word’s Mail Merge fea­ture. Then one day, some­one asked me if I can find a bet­ter and eas­ier way to help the non web peo­ple to main­tain a site. I started out with search terms like “jQuery read text files” or some­thing like that, one of the results returned as using CSV and there is a plu­gin called CSV2Table in the jQuery Plu­g­ins web­site by Toshiro Taka­hashi writ­ten ear­lier this year. Test­ing… (more…)

This is going to be a short post. Magic Tags are very awe­some, but on the Pods CMS doc­u­men­ta­tion failed to men­tion some­thing very sim­ple yet use­ful. Before any­thing, here’s a quick run down of what Magic Tags are…

(more…)

Soft­ware note: Pods CMS Ver­sion 1.7.3 / WP 2.8.4

Doc­u­men­ta­tion: http://pods.uproot.us/codex/helpers

What are Input Helpers

An Input Helper lets you com­pletely cus­tomize the appear­ance of any input field… when adding new data contents.

In plain n00b Eng­lish: as an exam­ple, the default field “name” I had it to store last names, and a sep­a­rate col­umn to store first names (fname). The prob­lem of that would be when you’re using Bi-directional rela­tion­ship PICK col­umn to another Pod (let’s call this: Per­son) is you can only relate one of the columns, not both First Name and Last Name. So if you use the PICK col­umn the “name”; which stores the Last Names, and with the last name like John­son – you prob­a­bly can’t tell which John­son that is. Input Helpers can grab and dis­play the full names for you when you’re adding data. (more…)

I’ve been very silent on Face­book, Twit­ter, and this blog lately. That because I can’t con­stantly access Twit­ter any­more from work, they blocked me… so no more use­ful stuff to tweet and brag about excepted one thing: Pods CMS. Pods CMS is a Word­press plu­gin that pretty much turn your blog into a CMS. You can build a Wiki, Glos­sary, Recipes, Hotel list­ing etc… the pos­si­bil­i­ties are end­less. Although, you will need to know at least some PHP to make this thing tuned to the way you want it to be. I have been play­ing with it in the past 2 weeks, I have to say I am very impress of how this plu­gin works. So I did a test on one of my hob­bies: Kendo. I’ve always wanted to col­lect data on Kendo Dojo, how many prac­ti­tion­ers, and Kendo tour­na­ment results in the U.S. I was able to cre­ate this very com­plex data­base that it can be listed by Fed­er­a­tions, State, Coun­try, Dojo, and down to the indi­vid­ual Kendo-ist data. The awe­some thing is? Each list­ing can be linked to one another. For exam­ple, if you view­ing by Fed­er­a­tions, you can list all the Dojo in that fed­er­a­tion, and with links to each Dojo AND the state. You can add BUILT-IN fil­ters and search on top! The back­end is all done for you, all you have to do is to make things pretty. Ain’t that grant?

(more…)

This was one of the old posts that got cor­rupted when I did a rein­stall of WP 2.8.1.  Since this script is pretty handy, so I’m re-posting it.

This scripts worked in Acro­bat 8 & 9 Pro. Instead of of man­u­ally extract­ing all the pages, and then man­u­ally opti­mize them, this script can ease the process. To access the Batch Pro­cess­ing menu: Advanced -> Doc­u­ment Pro­cess­ing -> Batch Pro­cess­ing. The screen shot below shows where and how to add the script:

Acrobat Batch Extactions

Then add the fol­low­ing script into the “Javascript Editor”:

var filename = this.documentFileName.replace(".pdf","");
try{ for(var i = 0; i<this.numPages; i++)
    var num = i+1;
    this.extractPages({ nStart: i; });
    cPath: filename+"_"+num+".pdf"});
}cath (e){ console.println {"Aborted: " + e) }

Saves a lot of time if you have a lot of files to extract and need to opti­mized the files using cus­tom settings.