IE PNG problem when used with jQuery animate()

July 2nd, 2010

FREAKIN’ AWESOME UPDATE – 08/24/11: It appears this problem is now fixed (mostly?). HUGE shout-out to Micah Topping (a commenter below) for giving the link for this. If you now look at my cog animation above in IE7/8, this now works as I want it to, with no apparent differences. I did have to place the images within the divs rather than use a CSS background.

<div id="myWrapper"><img src="images/myImage.png" /></div>

And the CSS:

#myWrapper img {
background: transparent;
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)"; /* IE8 */   
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);   /* IE6 & 7 */      
    zoom: 1;
}

One finaly note….I DID have to take this out of my script that I am using or it wouldn’t work. It was overwriting the filter being put on by the CSS (full script shown further down):

'filter': ''

Even more applause goes to Dan Tello who gave the solution here. I tried the jquery script that was provided there, but I could not get that to work.

END OF UPDATE!

Before I go into what I want to talk about tonight, I need to first toot my own horn a little. I received an email from one of the editors over at onextrapixel.com, inviting me to be a guest writer. Now who knows what will happen with that, but I am extremely excited and honored that they would ask me. I put a lot of work into The Web Machine, so I am just a little bit proud that they would ask me. I am nervous, but in a good way. Here, I can write how I want because its my blog. There, I just hope I don’t embarrass myself. Wish me luck, and I’ll keep you informed of what happens. Seriously, thanks to onextrapixel.com for asking. You made this blogger/web developer very happy just by doing so.

Now…FORWARD! Onto the meat of the post! I should warn you though, that it is partly a story too.

If you have been paying attention here, and reading my posts, you will notice I implemented an animation on my logo using jQuery. I’m quite proud that I got this to work with so little code. Or, at least that was what I thought. The main goal was to fade in the cogs one at a time in sequential order while moving them a certain distance to the left. Just for a refresher, here is the code again:

var cogs = $('#cog1, #cog2, #cog3, #cog4, #cog5').css({'opacity' : 0});
	i=0;
	leftAmount = 0;
 
	function cogMovement () {
		$(cogs[i++]).animate({
				'left': 63 * leftAmount++,
				'opacity': 1,
				'filter': ''
			}, 800, arguments.callee);
 
	};
	cogMovement();

Read the rest of this entry »

CSS – Hacking the hell out of browsers

June 29th, 2010

I’ve done small posts when I started doing this blog a while back, that included tips on how to hack certain browsers with CSS. I thought it would be good to list them all in one spot. I have been thinking of writing a small e-book that included all the things I have learned that I wish I knew from the start. Kind of like a super crash course in web development. Most of the things I write about, are things that would have been useful to me when I started out, but took a lot of time using google, reading, and just plain trial and error. I like to think I’m helping new web developers/designers get a kick start in their learning, and get ahead of the curve, which is what keeps me going. I actually really like mentoring new to intermediate web devs, and that is what keeps me writing this blog. Besides that, I actually end up learning more myself.

There are things that have to be done to make sure your site works in all browsers, and sometimes that means you have to do some things in your CSS to make sure everything is nice. I am going to show you the major methods of how to what we call “hack” a css file so that the browsers display the same thing. Let it be known, that it took me a while to be able to design a site without worrying about IE6. At the start, concepts of float, how margins and padding work, and other such things can be very confusing. I did a lot of hacking in the beginning before I knew how to build a site correctly. It would be great if you could just write the CSS and it all worked perfect, but even now, every once in a while, you have to do some fiddly things to get the older IE’s to cooperate. Let it be known, that I use the IE6 one quite a bit for image replacement, and if you do use these, you actually should put them in a seperate IE stylesheet. For getting things up and running quick though, I keep them in the main CSS file until I am done, and then take them out.

Now onto hacking!

Read the rest of this entry »

Creating your own web dev tool kit – Part III: Apps that help

June 25th, 2010

Workflow applicationsAside from the basic software that we all use to do what we do, I thought I would list some other helpful software/web apps that help me in my workflow. I won’t go over editors and such, cause there are a billion and we all have our preferences (NetBeans and Dreamweaver for me!), nor will I go over the graphic programs (Photoshop, Fireworks, Illustrator…). I’m talking about the other, OTHER applications we use from day to day to help us along.

EVERNOTE

Evernote imageLet’s start with my favorite, Evernote. If you haven’t read my very early posts where I mentioned this bit of awesome, I suggest you download it, which you can do here. Think of Evernote as a place to put all the crap that you want to remember, but can’t. Your brain has limited space, you can’t be expected to know all this stuff. Which is why the gods made Evernote. You create categories, create however many notes you want, tag the notes to make searching easy (I have one for jQuery and CSS so I can find that when I need it), paste links into it. One giant organized scrap book of knowledge.

Its what I use for all my code snippets and links to cool stuff, and how to do things I don’t have the memory for. The best part is, besides being free, after you create an account, you can access your Evernote notebook ANYWHERE. You can add stuff to it on your machine at work, you can go home, sync the account, and access it there. Your info is with you wherever you go. Download it. You won’t be sorry. Out of everything I use to do my job, THIS is one of the most important pieces.

Read the rest of this entry »

Quick post…checking out WP 3.0

June 24th, 2010

Just making a quick post about my foray into WordPress 3.0. As if you didn’t know, I use Host Gator for all my web hosting. I know I shamelessly plug them, but one of the reasons I love this host, is I can install a new WordPress installation on a click of a button, and entering text in a couple fields. Anyway, I created a new folder and installed it (2.9.2). I then did the auto upgrade to 3.0, and it took like 5 seconds with no problems. I then installed all of the plugins I have on this install, and activated them. This also went without a hitch.

I then tooled around in it. The feel is the same, and you will find everything where it should be. The menu editor is indeed cool. Very easy to use, and I only touched it for about a minute. Now that this trial went smooth, I think I will upgrade my version this weekend…AFTER I have backed up my database.

Please note: If you are going to upgrade, make sure to go to the WordPress forums and read through the instructions per version you have. If you have 2.9.2 like I did, deactivate your plugins before upgrading.

jQuery Sequential animations revisited…real world example

June 23rd, 2010

I am thinking of redesigning my main website using my JC Designs cog logo that you see at the top of this blog. I thought to myself, wouldn’t it be cool if I animated it a little? In fact, why not do something that I did a few posts ago (can view post here), and move each cog left while fading in. Whatever I come up with for the design, won’t look like this blog, but I do want to keep the logo. So I did a test run to see if it would work.

Click here to see what I came up with.

Read the rest of this entry »