zithromax online

Tag-Archive for » javascript «

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 [ ... ]

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 [ ... ]

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 [ ... ]

innerHTML, innerText and textContent

innerHTML, innerText, textContent, html() and text()? Assuming we have a div block that contains two lines of text and a hyperlink. We want to enable inline editing so that we only edit the text and not HTML. div block for inline editing And when we click the edit action, we want to be able to edit it in a textarea. Welcome to http://www.test.com! Hope you enjoy it! Obviously, if we use innerHTML (or jQuery’s .html()), the textarea would show: Welcome to <a target="_blank" href="http://www.test.com">http://www.test.com</a>! <br><br>Hope you enjoy it! inline editing that incorrectly shows HTML code I do not want HTML tags! What [ ... ]

jQuery Conference 2010: Key Takeaways

The past weekend is all about jQuery, JavaScript and web development. Similar to many other tech conferences, the jQuery conference at Microsoft’s campus in Mountain View allows developers to choose one of the two available sessions at a time slot. For me, making choices on weekends is often not desired, especially when I do not want to miss out anything. Here I am going to share the takeaways from half of the sessions I attended. Ads, widgets, and analytics – Steve Souders A similar talk on site performance was given earlier at JS Conf. See the recap here at Ajaxian. Steve recommended using [ ... ]