Re: [jQuery] PNG Fix and the browser sniffer

2007-03-23 Thread Robert O'Rourke
Olaf Bosch wrote:
 Robert O'Rourke schrieb:

   
 The intention is to slice up that massive background image on the fly 
 which is easy to do with the cms I'm using, I am going to have a set of 
 images for choosing the big background image or for getting rid of it 
 altogether down one side so I need the png support...
 

 o.k. then, make it over CSS, so

 first add two DIV a id=png_head and id=png_foot
 then give the two images a class=hidden

  !--[if lt IE 7]
  link href=ie5-6.css type=text/css rel=StyleSheet 
 media=screen /
  ![endif]--

 in ie5-6.css write
 .hidden{
 position:absolute;
 left:-1000em;
 top:-1000em;
 }
 #png_head{
 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='head.png', 
 sizingMethod='image');
 width: 100px;
 height 100px;
 /* positions margins and so on */
 }
 #png_foot{
 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='foot.png', 
 sizingMethod='image');
 width: 100px;
 height 100px;
 /* positions margins and so on */
 }

 No JS required, untested, writing errors+other trouble include ;)
 This are my way to go with this problem. The best is the simple,
 no tons of scripting :)

   

Got it sorted now, thanks Olaf.
I was getting carried away with jQuery, it's slowly starting to make 
sense and I'm really getting into it now. Just have to be careful not to 
overdo it :-)

Rob

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] PNG Fix and the browser sniffer

2007-03-22 Thread Benjamin Sterling

Rob, I would actually put  if ($.browser.msie  $.browser.version.number()
 7) { before the return.  Not sure if that will help.  Do you have an
example page we can look at.

this is some code I am using on a site that works fine for background images
that don't repeat.


--
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] PNG Fix and the browser sniffer

2007-03-22 Thread Benjamin Sterling

Would have been nice if I actually posted the code:

jQuery.fn.pngFixer = function(){
   try{
 if (navigator.appVersion.match(/MSIE [0-6]\./)) {
   $(this).each(function () {
 if (this.currentStyle.backgroundImage != 'none') {
   var image = this.currentStyle.backgroundImage;
   image = this.currentStyle.backgroundImage.substring(5,
image.length - 2);
   $(this).css({
 'backgroundImage': 'none',
 'filter': progid:
DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop,
src=' + image + ')
   });
 }
   });
 }
   }
   catch(e){
   $.log('ERROR: (pngFixer)' + e.name + ': ' + e.message);
   }
}

--
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] PNG Fix and the browser sniffer

2007-03-22 Thread Robert O'Rourke
Benjamin Sterling wrote:
 Would have been nice if I actually posted the code:

 ...
 -- 
 Benjamin Sterling
 http://www.KenzoMedia.com
 http://www.KenzoHosting.com
   


Cheers Ben,
Unfortunately with that code now I'm getting zero transparency... The 
sites still kinda ropey and I can't design web 2.0 style to save my 
life, nevertheless you can see the problem page(s) here: 
http://www.ipg.quicksite.dev.versatilia.com

It's on the dev server but it's ok to have a look, I need to get the 
logo and the 'as seen on 4' images to be filtered in IE=6. Only 2 pngs!
I really appreciate your help and getting back to me so quickly.

Rob O'Rourke

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] PNG Fix and the browser sniffer

2007-03-22 Thread Robert O'Rourke
Olaf Bosch wrote:
 Robert O'Rourke schrieb:

   
 It's on the dev server but it's ok to have a look, I need to get the
  logo and the 'as seen on 4' images to be filtered in IE=6. Only 2
 pngs! I really appreciate your help and getting back to me so
 quickly.
 

 For what you hacking around. On this site are all fixed, you cane this
 two pictures integrate in the great Background also. And that for all
 Browser.

 The Link in the HeaderIMG you can give display:block; width+height and a
 little bit margin an the User cane used also.

 No IMG-Tag required.

   

The intention is to slice up that massive background image on the fly 
which is easy to do with the cms I'm using, I am going to have a set of 
images for choosing the big background image or for getting rid of it 
altogether down one side so I need the png support...

Rob

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] PNG Fix and the browser sniffer

2007-03-22 Thread Olaf Bosch
Robert O'Rourke schrieb:

 The intention is to slice up that massive background image on the fly 
 which is easy to do with the cms I'm using, I am going to have a set of 
 images for choosing the big background image or for getting rid of it 
 altogether down one side so I need the png support...

o.k. then, make it over CSS, so

first add two DIV a id=png_head and id=png_foot
then give the two images a class=hidden

 !--[if lt IE 7]
 link href=ie5-6.css type=text/css rel=StyleSheet 
media=screen /
 ![endif]--

in ie5-6.css write
.hidden{
position:absolute;
left:-1000em;
top:-1000em;
}
#png_head{
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='head.png', 
sizingMethod='image');
width: 100px;
height 100px;
/* positions margins and so on */
}
#png_foot{
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='foot.png', 
sizingMethod='image');
width: 100px;
height 100px;
/* positions margins and so on */
}

No JS required, untested, writing errors+other trouble include ;)
This are my way to go with this problem. The best is the simple,
no tons of scripting :)

-- 
Viele Grüße, Olaf

---
[EMAIL PROTECTED]
http://olaf-bosch.de
www.akitafreund.de
---

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/