Category Archives: jQuery

Primal Screen website launch

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 , , , , , , , , , | Leave a comment

Fix: CSS Animation slow or choppy in mobile browsers

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

Posted in HTML/CSS, HTML5, iOS, Javascript, jQuery, PhoneGap | Tagged , , , , , , , , , | 6 Comments

TypeKit (@font-face) font’s look like crap in IE7 & IE8 when animated with jQuery

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 , , , , , , , , , , , | Leave a comment

Make your own live, auto-updating data feed with PHP (CodeIgniter) and Javascript (jQuery)

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

Posted in CodeIgniter, Javascript, jQuery, PHP | Tagged , , , , , , , , , , , , , , , , , | 1 Comment

Load more content as the user reaches the bottom of your page, with jQuery

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 , , , , , , , , | 3 Comments

Find the Pixel perfect position of an element with jQuery (and keep elements always visible)

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 , , , , , , | 2 Comments

Use jQuery to attach an event to a key press

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 , , , , , , , , , , | Leave a comment

UPDATE: jQuery: Get all objects of selector, and then loop through them

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

Posted in HTML/CSS, Javascript, jQuery | Tagged , , , , , , | 1 Comment

CodeIgniter Rejecting Ajax XMLHttpRequest from jQuery?

I have a javascript/jQuery ajax function that tries to post some data to a URL in my CodeIgniter installation, and it fails. Looking at the console it gives me this message XMLHttpRequest cannot load http://www.DOMAIN.com/chris/calendar/async/update/assignment/325. Origin http://DOMAIN.com is not allowed … Continue reading

Posted in CodeIgniter, HTML/CSS, Javascript, jQuery, PHP | Tagged , , , , , , , , | Leave a comment

Convert Em size to Pixels with jQuery

I was trying to use jQuery-UI’s awesome resizable function on a new web app I’m developing, and it turns out that it doesn’t play nicely with ems. At least it’s grid options don’t. Anyway, I found the need to convert … Continue reading

Posted in HTML/CSS, Javascript, jQuery | Tagged , , , , , , , | 1 Comment