- If something on this blog saves you an hour of frustration, and you want to say thanks, throw me a dollar or two. It'll help me buy more diet coke which, let's face it, is the primary fuel for this blog.
-
Recent Posts
- Stop Google from hijacking arrow key presses on Search Result pages
- iTunes Match stuck on “Step 1: Gathering information about your iTunes Library”
- Primal Screen’s Mic AS3 Output class
- UPDATE: Fix: CSS Animation slow or choppy in mobile browsers
- Prevent Mobile Safari from zooming in when device rotates
- Primal Screen website launch
- Fix: CSS Animation slow or choppy in mobile browsers
- Socket.io 0.7 – Sending messages to individual clients
- CSS z-index doesn’t do anything, inspector computed style says it’s z-index:auto
- TypeKit (@font-face) font’s look like crap in IE7 & IE8 when animated with jQuery
- AS3 Component Parameters always NULL or empty? Here’s an even better fix.
- After Effects Expression: Snapping objects to whole pixels
- Use Google Fonts (they’re free, and not half bad) in your site
- Basics: What PHP version does my server run?
- Make elements hang outside your main page container, without triggering scrollbars if the window is too narrow
Archives
Categories
Meta
Category Archives: Javascript
Did I mention that our new website launched? Primal Screen website (100% of code and 75% of design by yours truly). Oh, and I’ll never write another website in that bloated carcass of a useable PHP framework: Zend Framework. My … Continue reading
Posted in Actionscript/Flash, CodeIgniter, HTML/CSS, HTML5, Javascript, jQuery, PHP, Zend
Tagged CSS, html, html5, javascript, jquery, js, primal, primalscreen, screen, zend
Leave a comment
I’m developing an iPhone app using the PhoneGap library, which lets you write your app as if it were a website. That means any UI transitions or animations have to be written the way you would for any modern website … Continue reading
Internet Explorer does a pretty lousy job of displaying fonts anyway, especially fonts from all those new we font websites such as TypeKit (who I strongly recommend). But when you use, say, jQuery’s fadeIn() effect like this $(“.fadeThisGuy”).fadeIn(); … type … Continue reading
Posted in HTML/CSS, Javascript, jQuery
Tagged @font-face, animate, crappy, CSS, fade, filters, IE, ie8, internet explorer, jquery, opacity, typekit
Leave a comment
EDIT: I guess you don’t need to store the last entry time in a cookie, storing it in a simple js var works fine. I’ve updated the code to reflect this. EDIT2: If your server isn’t doing a good job … Continue reading
Actionscript/Javascript: var n = 10; while (n–) { // looped code } PHP: $n = 10; while ($n–) { // looped code }
Posted in Actionscript/Flash, Javascript, PHP
Tagged code, for, i, loop, n, running, simple, simplest, times, while, x
Leave a comment
I recently built a project gallery for Primal Screen’s new website (not live yet). Instead of having the traditional < 1 2 3 4 5 > pagination setup, we decided to take a leap forward into the the world of … Continue reading
Posted in HTML/CSS, Javascript, jQuery
Tagged ajax, async, gallery, javascript, jquery, load, post, scroll, thumbnails
3 Comments
If you need to know the exact x and y positioning of any element on your page (relative to the viewport), use jQuery like this. var x = $(“#myElement”).offset().left; var y = $(“#myElement”).offset().top; Then you can do stuff like this … Continue reading
Posted in HTML/CSS, Javascript, jQuery
Tagged javascript, jquery, offset, position, positioning, scrollleft, scrolltop
2 Comments
Keep in mind that some browsers don’t let jQuery know about certain key presses. For example, Chrome doesn’t send the event for keyCode 27 (escape), but Safari does. $(document).keypress(function(e) { if (e.keyCode == 13) { alert(“You pressed Enter!”); } }); … Continue reading
Posted in HTML/CSS, Javascript, jQuery
Tagged char code, charcode, detect, javascript, jquery, key, keyCode, keydown, keypress, keystroke, onkeypress
Leave a comment
In my original post I mentioned how one can use the get() function in jQuery to gather up all the selected DOM elements and put them in an Array, like so: var stuffArray = $(“.stuff”).get(); Well here’s another way to do … Continue reading