Blog 1

Random Talk on Random Thoughts

Changed My FancyBoxLocal.js

| Comments |

Background

I’ve been using fancyBox for image popup since August.1

Problem

I would like to have large screenshots which belongs to the fancybox CSS class centre-aligned.

Solution

Refer to source/javascripts/FancyBoxLocal.js at commit 460b575 for details.

I successfully worked out another solution using JavaScript regular expressions. However, after looking at jQuery’s removeClass() method in it’s API documentation, I dediced to start it all over again using jQuery due to the simplicity of this approach.

Lessons learnt

In Vim’s search pattern, \> denotes the end of a word. It took me a while to find out its counterpart in JavaScript\b. The character ‘b’ stands for “boundary”.


Comments