Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
transparetni background u ie6

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
darkqueliss



Joined: 27 May 2008
Posts: 1058

PostPosted: 05.06.2008 08:32    Post subject: transparetni background u ie6 Add user to your forum ignore list Reply with quote

evo zanima me kad bi išao radit trasnaprentni bg kako bi to izgledalo...

I sad išao sam vidjet na ovaj site http://blog.medianotions.de/en/articles sve super izgleda, prejebeno... kad ono u ie6 katastrofa... jel ima koji način da se transparetni bg vidi i u ie6, jednako kao i u ie7 il ff...
Back to top
View user's profile Send private message
fun.ky



Joined: 05 Jan 2006
Posts: 365
Location: Mostar

PostPosted: 05.06.2008 09:36    Post subject: Add user to your forum ignore list Reply with quote

Here's the code i use (Background images):


Code:
// === SLEIGHT.JS CODE (Copyright© YoungPup) WITH MODIFIED CSS-INLINE IMAGE SUPPORT ========================
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
document.writeln('<style type="text/css">img { visibility:hidden; } </style>');
window.attachEvent("onload", fnLoadPngs);
}

function fnLoadPngs() {
var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);

for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {
if (itsAllGood && img.src.match(/\.png$/i) != null) {
var src = img.src;
img.style.width = img.width + "px";
img.style.height = img.height + "px";
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"
img.src = "images/spacer.gif"; // change this to your own gif
}
img.style.visibility = "visible";
}
}

if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
window.attachEvent("onload", alphaBackgrounds);
}

function alphaBackgrounds(){
var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
for (i=0; i<document.all.length; i++){
var bg = document.all[i].currentStyle.backgroundImage;
if (itsAllGood && bg){
if (bg.match(/\.png/i) != null){
var mypng = bg.substring(5,bg.length-2);
document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='scale')";
document.all[i].style.backgroundImage = "url('images/spacer.gif')"; // change this to your own gif
}
}
}
}


That also works for PNGs applied as background images (even in external stylesheets). All you have to do is change all mentions of 'images/spacer.gif' in the code above to the location of a 1px*1px transparent GIF.

warning: if you use a DIV (for example) with a PNG24 background image, and that DIV has a hyperlink in it, the hyperlink will become unclickable since the JS works by overlaying the transparent GIF over the element with the PNG. Weird that; someone exploits a bug in IE which fixes another bug.

======================================================

Png kao slike


After searching what seemed like forever, I found a little hack to make IE on Windows allow alpha transparency in PNG images.

I'm sure someone will ask: "Why not just use a GIF?"...
The answer is simple... take a look...
Sample images have been lost

you should download the images and try placing a different color background on them than white. you will then notice that the GIF does not allow true alpha transparency and creates a white border around the image.

all you need to do to make this work is to add this little javascript to your page:
<!--[if gte IE 5.5000]>
<script type="text/javascript" src="pngfix.js"></script>
<![endif]-->


add the following into a monospace text file and name it pngfix.js and place it in the root directory:
Code:
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.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
var imgAttribs = img.attributes;
for (var j=0; j<imgAttribs.length; j++)
{
var imgAttrib = imgAttribs[j];
if (imgAttrib.nodeName == "align")
{
if (imgAttrib.nodeValue == "left") imgStyle = "float:left;" + imgStyle
if (imgAttrib.nodeValue == "right") imgStyle = "float:right;" + imgStyle
break
}
}
var strNewHTML = "<span " + imgID + imgClass + imgTitle
strNewHTML += " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
strNewHTML += "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
window.attachEvent("onload", correctPNG);

_________________
There is no style definition for good music!
Back to top
View user's profile Send private message Visit poster's website Twitter profile
darkqueliss



Joined: 27 May 2008
Posts: 1058

PostPosted: 05.06.2008 10:13    Post subject: Add user to your forum ignore list Reply with quote

hvala, probat cu kad doma dodem...
Back to top
View user's profile Send private message
LifeCanBeFun



Joined: 28 Apr 2006
Posts: 228
Location: Istra

PostPosted: 05.06.2008 18:08    Post subject: Add user to your forum ignore list Reply with quote

da se rjesit i za ie6 da radi...

http://www.twinhelix.com/css/iepngfix/

_________________
www.netlex.hr
Back to top
View user's profile Send private message Visit poster's website Twitter profile
darkqueliss



Joined: 27 May 2008
Posts: 1058

PostPosted: 05.06.2008 21:36    Post subject: Re: transparetni background u ie6 Add user to your forum ignore list Reply with quote

uspio sam ovo s jednom drugom skriptom, e sad me zeza to što linkani logo.png u ie6 pokazuje tako da uz sliku dobijes i onaj X i alt... tj prikazuje se border, kako rješit to?

border:none; ne šljaka....
Back to top
View user's profile Send private message
LifeCanBeFun



Joined: 28 Apr 2006
Posts: 228
Location: Istra

PostPosted: 06.06.2008 00:14    Post subject: Add user to your forum ignore list Reply with quote

to je isto rjeseno preko ovog što sam ti linkao... imas blank.gif koji prekrije to tako da ti se x ne pojavljuje

_________________
www.netlex.hr
Back to top
View user's profile Send private message Visit poster's website Twitter profile
killa



Joined: 12 Sep 2003
Posts: 277
Location: zagreb

PostPosted: 06.06.2008 08:18    Post subject: Add user to your forum ignore list Reply with quote

http://snipplr.com/view/6094/png-support-in-internet-explorer-55--6-with-working-links/


http://24ways.org/2007/supersleight-transparent-png-in-ie6

_________________
[killa bee]
Back to top
View user's profile Send private message Visit poster's website
darkqueliss



Joined: 27 May 2008
Posts: 1058

PostPosted: 06.06.2008 08:39    Post subject: Add user to your forum ignore list Reply with quote

LifeCanBeFun wrote:
to je isto rjeseno preko ovog što sam ti linkao... imas blank.gif koji prekrije to tako da ti se x ne pojavljuje


evo sad radi... al ne kuzim, sad na srednjem divu mi je nestao bg, a ostali su dobri... lol kako me hebe ovo... posalo sam ti PM, pa ako uhvatiš vremena da pogledaš...

taj bg na srednjem divu nestao je samo u ie7, i ie6... u FF se vidi...

hvala
Back to top
View user's profile Send private message
darkqueliss



Joined: 27 May 2008
Posts: 1058

PostPosted: 16.06.2008 23:29    Post subject: Add user to your forum ignore list Reply with quote

zakaj ne prolazi ovaj vrag validaciju, jel se da kako to rjesit?

Back to top
View user's profile Send private message
dr_Hate



Joined: 28 Aug 2007
Posts: 168
Location: Rijeka

PostPosted: 17.06.2008 00:10    Post subject: Add user to your forum ignore list Reply with quote

jasi wrote:
zakaj ne prolazi ovaj vrag validaciju, jel se da kako to rjesit?


direktno u glavu/head sutni pa ce proci validaciju Wink

Code:
<!--[if lt IE 7]>
<style type="text/css">
* html body{behavior: url("iepngfix.htc");}
</style>
<![endif]-->

_________________
imam domenu |stajduhar.org|
Back to top
View user's profile Send private message Visit poster's website
darkqueliss



Joined: 27 May 2008
Posts: 1058

PostPosted: 17.06.2008 07:25    Post subject: Add user to your forum ignore list Reply with quote

sad prolazi validaciju, ali u ie6 ne šljaka, nije transparentni bg...

kaj da radim?
Back to top
View user's profile Send private message
Nemesis



Joined: 01 Oct 2005
Posts: 732

PostPosted: 17.06.2008 08:50    Post subject: Add user to your forum ignore list Reply with quote

Savjetuj ljudima na ulazu da updateaju browsere ili instaliraju firefox. Posebno se potrudi isprdati ljude koji koriste IE6 ili nedaj Bože IE5 jer imaju browser star 5 godina i kako ih nije sram.

E da, ispod stavi Google Adsense koji nudi $1 po downloadu i instalaciji Firefoxa... Very Happy

_________________
Webastično.com | Last.fm | Twitter
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger Twitter profile
darkqueliss



Joined: 27 May 2008
Posts: 1058

PostPosted: 17.06.2008 09:00    Post subject: Add user to your forum ignore list Reply with quote

Nemesis wrote:
Savjetuj ljudima na ulazu da updateaju browsere ili instaliraju firefox. Posebno se potrudi isprdati ljude koji koriste IE6 ili nedaj Bože IE5 jer imaju browser star 5 godina i kako ih nije sram.

E da, ispod stavi Google Adsense koji nudi $1 po downloadu i instalaciji Firefoxa... Very Happy


lol Smile nije loša ideja, da bar hoće ukinuti sve IE-ove, osim sedmice...
Back to top
View user's profile Send private message
dr_Hate



Joined: 28 Aug 2007
Posts: 168
Location: Rijeka

PostPosted: 17.06.2008 11:00    Post subject: Add user to your forum ignore list Reply with quote

jasi wrote:
sad prolazi validaciju, ali u ie6 ne šljaka, nije transparentni bg...


e to ne znam, sorry, ja sam to koristio za sekundarnu navigaciju i csshover2.htc, ne za transparentni bg Wink

_________________
imam domenu |stajduhar.org|
Back to top
View user's profile Send private message Visit poster's website
darkqueliss



Joined: 27 May 2008
Posts: 1058

PostPosted: 17.06.2008 11:22    Post subject: Add user to your forum ignore list Reply with quote

dam, jel zna netko možda kak složit da prolazi validaciju?

edit: netreba slozio sam sa gifom...
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group