/    Sign up×
Community /Pin to ProfileBookmark

2 script coincide error

Alright, I am using this script to highlight a picture onmouseover (changing it to a highlighted version of the picture).

[CODE]<a href=”index.php” onmouseover=”javascript:document.img01.src=’images/main-h.png'” onmouseout=”javascript:document.img01.src=’images/main.png'”>
<img name=”img01″ src=”images/main.png” border=”0″ alt=”Main”></a>[/CODE]

And since I am using .pngs, this is the script that I am using to make them work in IE.

[CODE]function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
var arVersion = navigator.appVersion.split(“MSIE”)
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (document.body.filters))
{
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
if (img.align == “left”) imgStyle = “float:left;” + imgStyle
if (img.align == “right”) imgStyle = “float:right;” + imgStyle
if (img.parentElement.href) imgStyle = “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 + “‘, sizingMethod=’scale’);”></span>”
img.outerHTML = strNewHTML
i = i-1
}
}
}
}
window.attachEvent(“onload”, correctPNG);[/CODE]

However in Internet Explorer, because of the fix, the script I am using for the rollover doesn’t work. I was hoping maybe the javascript I am using to fix the PNG pictures could be editied to fix this. Please let me know, any help would be greatly appreciated, thanks.

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJul 20.2006 — Whew! It looks like you are standing on your head to use the png files. Not sure what to suggest.

Can you post a link?
Copy linkTweet thisAlerts:
@bmassauthorJul 20.2006 — http://www.vvclans.com/db

/db is just the directory that I have uploaded my work for the layout on. I'm sure it has something to do with the code that I am using, because without the pngfig the highlighting works fine, but of course the images are all messed up in IE.
Copy linkTweet thisAlerts:
@bmassauthorJul 21.2006 — Hate to double post, but this has been bumped to the next page a is a fairly urgent matter. Some support would be really nice. Thanks.
Copy linkTweet thisAlerts:
@gil_davisJul 21.2006 — Your link is a 404.
Copy linkTweet thisAlerts:
@Orc_ScorcherJul 21.2006 — A PNG + mouseover script already exists: http://homepage.ntlworld.com/bobosola/png_mouseover.htm
Copy linkTweet thisAlerts:
@bmassauthorJul 21.2006 — Thank so much you have really saved my ass on this one. And also a big thanks to everyone else who has helped be design this website layout, and who has helped with my actual website (this is just a layout for a client that I am designing a website for). Funniest thing is, the website with the solution to this problem is the exact same website that I used for the first javascript.
Your link is a 404.[/QUOTE]
Your right, sorry it's fixed. My domain is vvclans.com not vvclan.com.

You may have seen a flicker on page load, as this code is called inline and does not use the 'include file and defer keyword' method. You can of course hack such a file yourself to get rid of the flicker.[/QUOTE]

This was said on the site you gave me. I was wondering if anyone knew how to do this? Thanks. This is not so urgent anymore, as I got the important thing done, but when someone doesn't mind, could you please let me know about this? Thanks.
Copy linkTweet thisAlerts:
@bmassauthorJul 22.2006 — I figured it out myself. I managed to get it to stop flickering, but then the switching stopped working. I am using [URL=http://www.vvclans.com/db/pngfix.js]this[/URL] to fix the PNGs in IE, [URL=http://www.vvclans.com/db/switchfix.js]this[/URL] to fix the switching, but when I add in [URL=http://www.vvclans.com/db/flicerfix.js]this[/URL] to fix the flicker, the switch fix stops working. Can anyone help with this? Thanks.
Copy linkTweet thisAlerts:
@bmassauthorJul 28.2006 — Can anyone help me with this? I searched their site as much as possible but I couldn't find any support for it. Thanks.
×

Success!

Help @bmass spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...