views:

322

answers:

2

Hello, i'm using DD_Belated.png to save all IE6 users from seeing the madness of unsupported png.

However, this great script takes either selector or DOM Element as parameter to it's only function to do it's magic and return working PNG to IE6.

Me, being lazy programmer, did something like this:

$("img[src$=png], #search").each (
  function() { 
    DD_belatedPNG.fix( *what-here* ); 
});

SO, basically I need some jQuery function to return DOM Element from $(this).

BTW, neither $(this).get(), $(this).get(0) nor $(this)[0] does work in IE6

Thank you.

Edit: Once again, the problem was between monitor and seat - in me. There are two methods - one for selector string and one for DOM Element. I used the first one for both - and I thought I'm not passing good argument with this, so I began to look into different - well, I did not gave the right argument - It expected string...

+5  A: 

In your .each function, the "this" variable will be your DOM element. Thus:

DD_belatedPNG.fix(this);

should do it.

I'll add, sadly, that I've never gotten any IE6 PNG fixers to work, at least not really work.

Pointy
Me too, I found it better to dynamically change the CSS to load the .gif sprited images instead of the .png when IE6.
Alex Bagnolini
Than you should definitely try this one. Apart from this question i had (what was my mistake - I tried ...fix(this) first - for DOM elements is `...fixPng(this)`, it's brilliant solution from Drew Diller - works with background repeat, background position... like a charm.
Adam Kiss
+1  A: 

did you try DD_belatedPNG.fix(this);

Hogan
Yes, I tried it first. However read my edit please >.<
Adam Kiss