vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=229)
-   -   Forum Home Enhancements - fix png transparency (https://vborg.vbsupport.ru/showthread.php?t=180509)

RC. 05-25-2008 10:00 PM

fix png transparency
 
this code fix the png transparency problems whit ie5 and ie 6

this is very simple:
in the header template add this code very top:

PHP Code:


<!--[if gte IE 5.5000]>
<
script language="JavaScript">
function 
correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
for(var 
i=0i<document.images.lengthi++)
{
var 
img document.images[i]
var 
imgName img.src.toUpperCase()
if (
imgName.substring(imgName.length-3imgName.length) == "PNG")
{
var 
imgID = (img.id) ? "id='" img.id "' " ""
var imgClass = (img.className) ? "class='" img.className "' " ""
var imgTitle = (img.title) ? "title='" img.title "' " "title='" img.alt "' "
var imgStyle "display:inline-block;" img.style.cssText
if (img.align == "left"imgStyle "float:left;" imgStyle
if (img.align == "right"imgStyle "float:right;" imgStyle
if (img.parentElement.hrefimgStyle "cursor:hand;" imgStyle
var strNewHTML "<span " imgID imgClass imgTitle
" style=\"" "width:" img.width "px; height:" img.height "px;" imgStyle ";"
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
"(src=\'" img.src "\');\"></span>"
img.outerHTML strNewHTML
i-1
}
}
}
window.attachEvent("onload"correctPNG);
</
script>
<![endif]--> 



If you Like This Mod Mark INSTALLED

enjoy

dvbusuario 05-26-2008 01:04 AM

Install!!

Bonus Paradise 05-26-2008 06:26 AM

thank you for that! :)

Silvio 05-26-2008 10:31 AM

ty sir! *installed

echo2kk5 05-26-2008 03:32 PM

Does this work with 32 bit PNG images as well?

OcR Envy 05-27-2008 09:53 AM

Any problems with width/height going crazy? I've tried other png ie fixes that worked but had issues.

Wayne Luke 05-27-2008 02:35 PM

This solution is more elegant, less resource intensive and still valid:

https://vborg.vbsupport.ru/showthread.php?t=94416

Just by placing the javascript in an external file, you can significantly reduce page load and bandwidth simply because its cached in the end-user's browser. Not only that but IE7 and IE8 do not need this applied to PNG images since they support the Alpha Transparency natively.

OsiRiS_X 06-20-2008 04:28 PM

Install, Very Nice!

kencasanova 06-21-2008 04:16 PM

it doesn't work with mine. help!

CMGU 06-21-2008 05:08 PM

doesn't work for me


All times are GMT. The time now is 05:01 PM.

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.01043 seconds
  • Memory Usage 1,745KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete