vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   PNG Transparency for Internet Explorer (https://vborg.vbsupport.ru/showthread.php?t=91051)

Oblivion Knight 06-24-2005 10:00 PM

PNG Transparency for Internet Explorer
 
Ever wanted to allow your users to see transparent PNG images using Internet Explorer? Now you can!

[high]Note:[/high] I did NOT create this script, it remains the sole property of it's author.


Pros & Cons

Pros:
  • Ignored as a comment in other browsers, so no browser-sniffing code is required
  • Works with (X)HTML Strict & Transitional Doctypes
  • Does not break W3C validation
  • Lightweight and very easily deployed
  • Works with existing in-line or external CSS rules based on class or ID selectors
  • Works with old-style img align="left" or align="right" attributes
  • Adds itself to the end of any existing Body Onload code
  • Works with imagemaps and input images using a special version
Cons:
  • Doesn't work in IE versions earlier than 5.5
  • Requires JavaScript to be enabled - the estimations for how many people choose not to use JS vary wildly.
  • CSS backround PNGs not supported - experimentation revealed I could traverse the Stylesheets collection and use the AlphaImageLoader trick to replace all background-image attributes containing PNGs, but then background-repeat would not work, and anchors placed over non-transparent parts of the image were not clickable :-(
  • CSS rules for the PNG images based on the img selector are lost, but this is easily rectified by adding a class selector to your img rule such that img{..} becomes img,.png{..} - then add the attribute class="png" to each of your PNGs.

To install, simply upload the attached .js file to your /forums/clientscript/ directory.

Then edit your headinclude template, and add the following:
HTML Code:

<!--[if gte IE 5.5000]>
<script type="text/javascript" src="clientscript/vbulletin_pngfix.js"></script>
<![endif]-->

You're all set.! :)

Dan 06-25-2005 01:02 PM

Nice idea :) I've been looking for that css code recently so thanks :D

bigcurt 06-25-2005 01:08 PM

Thanks a MILLION oblivion, you rock. I like your site alot too man. Anyway

/me installs

Bad Bunny 06-28-2005 02:34 PM

Quote:

Originally Posted by bigcurt
Thanks a MILLION oblivion, you rock. I like your site alot too man. Anyway

[high]* bigcurt installs[/high]

It seems there was one already made to do this, but yours is significantly easier. No hacking is a big plus.

Oblivion Knight 06-29-2005 05:55 AM

Quote:

Originally Posted by Bad Bunny
It seems there was one already made to do this, but yours is significantly easier. No hacking is a big plus.

That, and I couldn't get theirs to work at all.. ;)

jugo 06-29-2005 11:53 AM

Mine works greate..WooHOo!!!

Thanks!!

Bad Bunny 06-29-2005 01:18 PM

Quote:

Originally Posted by Oblivion Knight
That, and I couldn't get theirs to work at all.. ;)

My site has theirs working, while my dev has yours. My issue right now is I have a mac with no pc to test it on. So I'll never really know if it does or doesn't work. heh

devilsmania 07-03-2005 03:28 PM

added it, but i have a problem....

while it recognizes the icons (*png) it wont render the Attached Avatars (and i find it important)

anything to modify into that .js file ? like instead of searching .png, it could find strings like image.php ?

Oblivion Knight 07-03-2005 07:16 PM

Not likely, because it would try to render .jpg and .gif attachments as .png's also.

Dark Zero 07-08-2005 10:26 AM

for solution that i only add the .png termination with script for the avatars


All times are GMT. The time now is 11:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01113 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete