Better CSS Part 4: Naming Conventions

When you are giving names to your ids and classes use names that are appropriate and clear. If you had a class just called “wrapper” and someone else was looking at your CSS they would have no idea what it is used for or where it’s in use. Give it a more descriptive name like “wrapper_header” or “wrapper_image”. I also prefer to use an underscore to seperate words in my class and id names, but it’s also acceptable to use camel case like “wrapperHeader” or “wrapperImage”. In my opinion I feel that using an underscore is more readable at a glance, but using camel case does get rid of a character if you’re really worried about file sizes.
Continue reading

Better CSS Part 3: ids vs. classes

This is a touchy subject. Whether you should use the id attribute or the class attribute in your HTML to style things with CSS. One thing is certain, XHTML standards say that ids must be unique. If you have multiple ids that are the same, then you need to refer to them with classes instead. With that out of the way, it seems clear to me that the majority of your styling is going to be done using classes.
Continue reading

JQTouch – Tap Event Handling for Browsers and Mobile Devices

JQTouch is an awesome platform when it comes to making a mobile optimized website. One problem that I run into a lot is that I develop on my PC, and it’s extremely cumbersome to debug and test on my mobile device during the development process. Instead, I use my PC browser to do most of my debugging and testing, then I just test out major revisions on my cell phone.

Continue reading

JQTouch DynamicHeight Extension

This is an extension for JQTouch (a framework built on top of JQuery) that allows you to build mobile optimized websites. This extension arose out of the need to have a dynamic min-height setting rather than relying on the static min-height settings in the jqtouch.css file. This allows for greater cross-browser compatability when aligning items to the bottom of a page or on background elements.

JQTouch Advanced Ajax Links

As I’ve been working with the JQTouch links, I’ve noticed that they don’t do a very good job with ajax links. It appears that those links will only work if they are nested in a <li> element. I have a button that sits at the bottom of my home screen that I want to have it load a dynamic page each time it’s clicked via ajax. I was able to do it with a relatively simple bit of code that I will credit Gonzalo Floria with at Google Code for JQTouch.
Continue reading