zoloft pills

Author Archive

IE bugs caused by CSS filter property fixed in jQuery 1.7

I assume that everyone knows about IE’s ‘filter‘ CSS property. We use it on IE< =8 mainly because they don’t support the W3C opacity property. The new jQuery 1.7 finally added a fix to an issue with IE’s ‘filter’ property. If you look at jQuery 1.7′s source code, you see that it does style.removeAttribute( “filter” ) when opacity is 1 upon setting the opacity csshook. The jQuery upgrade eliminates the need for us to do something like this: 1234j_obj.animate({opacity: 1}, 500, function() { $(this)[0].style.removeAttribute('filter'); // remove filter property at the end of animation... no longer needed in jQuery 1.7 and [ ... ]

Integrating Canvas into your Web App

My tutorial on HTML5 canvas has finally been posted to html5rocks!

Upgrading jQuery – from 1.4.x to 1.6.x

The jQuery library, specifically its architecture of Ajax handling, has been significantly re-written in 1.5. We at Box love jQuery, but we had to skip version 1.5 because a quick jquery.js file replacement failed many of our automated test cases. After a couple of weeks of debugging, we finally migrated to version 1.6.1. In this post, I want to share my experience upgrading jQuery from 1.4.4 to 1.6.1. prop() and attr() prop() is a new method to retrieve a property value of a DOM object, while attr() is used to retrieve attribute values written in the HTML source. attr() used [ ... ]

Popup blocker detection pattern

Have you ever wondered why popup blockers hate certain popup windows, but not others? The underneath formula is pretty simple: if a window.open() call is not on top of a click event in the call stack, popup blockers would block it unless it’s on the exception list. This can be verified using Firebug or Chrome Developer Tools. Call stack of window.open() triggered indirectly from a click event Call stack of window.open() triggered from an Ajax callback Therefore, the rule of thumb is that you should avoid calling window.open() from anything other than an user-initiated click event. What if it’s a [ ... ]

Switching between box models 2011

Do we all hate IE because the IE box model makes more sense? For those who don’t know and are lazy to look it up, prior to IE 6, IE used to include border and padding in its calculation of the width (and height) of a page element. This is different than the “standard” W3C box model, which defines width as only the width of the content, not including padding and border.

z-index misconceptions, IE bugs and fixes

Update (12/1/2011): Version 1.2 In the past 13 years, I have worked on numerous issues related to layering, specifically the z-index CSS property. It is one of the most misunderstood CSS properties. Surprisingly, there are not many well-written articles or tutorials on this topic. I came across this blog post that talks about the way to fix a z-index issue. It works as it nails the key point about the parent element, but there isn’t much explanation. You can find all the misconceptions written by other readers. To understand what z-index is, I find this to be the best beginner’s post. This post [ ... ]

Code Standards & Best Practices

This is the code standards doc that my previous team at Isobar/ Molecular created in early 2010. It was wildly circulated since its release. The doc contains a lot of knowledge that we have gathered in our combined 100+ years of web experience. You may find it useful if you are curious what best practices that third-party agencies are following. http://na.isobar.com/standards/

IE8 Developer Tools won’t open

This may sound stupid, but I ran into this issue that upon pressing F12 or choosing Tools > Developer Tools, the IE Developer Tools window does not show up. It is, however, showing up in the task bar. The issue is that when you have Developer Tools detached from the browser window, and you don’t close it before exiting the browser, the next time you open IE8 and try to run Developer Tools, the Developer Tools window will be an ‘invisible state’ (simply put…). The solution is to right-click on the tab/ icon in your Windows task bar and choose Maximize. If [ ... ]

Javascript shorthand for string comparison

Do you write this kind of code? (string1 == “test” or string1 == “staging” or string1 == “dev” or string1 == “internal” or string1 == “beta”) Think twice!

Attaching events to disabled input elements

I encountered an issue that all the attached mouseover and mouseevent events on a disabled checkbox <input type=”checkbox” disabled=”disabled”/> failed to work. After verifying the issue from a few references, I confirmed that this is an expected behavior of a disabled form element (button, input, optgroup, option, select or textarea). Many argued that if a form element is disabled, it should not trigger any event. However, for various reasons, I just need it to trigger certain events. For example, I may want a tooltip to appear when you hover on a disabled field to explain why the field is disabled. This requires [ ... ]