473,659 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pngfix.js and rollover in IE

I have an horizontal menu with a dreamweaver-generated rollover effect.
Images are png and their transparency is handled by pngfix.js
In IE, applied the pngfix, the rollover doesn't work at all. Obviously,
if I cut the pngfix the rollover works fine but the transparency of
images is gone.
Can anybody help me?
Thanks.
Aug 1 '05 #1
5 4176
or better...
which part of the following code interferes with onmouseover in IE?

function correctPNG()
{
for(var i=0; i<document.imag es.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpper Case()
if (imgName.substr ing(imgName.len gth-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:in line-block;" + img.style.cssTe xt
if (img.align == "left") imgStyle = "float:left ;" + imgStyle
if (img.align == "right") imgStyle = "float:righ t;" + imgStyle
if (img.parentElem ent.href) imgStyle = "cursor:han d;" +
imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" +
img.height + "px;" + imgStyle + ";"
+ "filter:progid: DXImageTransfor m.Microsoft.Alp haImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='s cale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
window.attachEv ent("onload", correctPNG);
Aug 1 '05 #2
"Bribro" <as***@asd.asdf > kirjoitti
viestissä:sd*** *************** **@news4.tin.it ...
I have an horizontal menu with a dreamweaver-generated rollover effect.
Images are png and their transparency is handled by pngfix.js
In IE, applied the pngfix, the rollover doesn't work at all. Obviously, if
I cut the pngfix the rollover works fine but the transparency of images is
gone.


I can't help you with the problem itself, but you'll be pleased to hear that
in IE 7 transparent png's are supported. In a couple of years we can leave
the disgusting png-fixes behind, once people have started using IE 7.

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.ber keley.edu/>

Soulman <et************ ****@5P4Mgmail. com>
Aug 1 '05 #3
Maybe the problem is including the management of onmouseover and
onmouseot events in this piece of code:

var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" +
"width:" + img.width + "px; height:" + img.height + "px;" + imgStyle +
";" + "filter:progid: DXImageTransfor m.Microsoft.Alp haImageLoader" +
"(src=\'" + img.src + "\', sizingMethod='s cale');\"></span>"

Am i wrong?
Aug 1 '05 #4
Bribro wrote:
or better...
which part of the following code interferes with onmouseover in IE?

function correctPNG()
{
for(var i=0; i<document.imag es.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpper Case()
if (imgName.substr ing(imgName.len gth-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:in line-block;" + img.style.cssTe xt
if (img.align == "left") imgStyle = "float:left ;" + imgStyle
if (img.align == "right") imgStyle = "float:righ t;" + imgStyle
if (img.parentElem ent.href) imgStyle = "cursor:han d;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" +
img.height + "px;" + imgStyle + ";"
+ "filter:progid: DXImageTransfor m.Microsoft.Alp haImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='s cale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
window.attachEv ent("onload", correctPNG);


Just guessing, but I'd bet it has to do with the width & hight actually
being set to 0 instead of what it should be... Doing that cause MSIE to
not show the image at all as if it was never there to begin with...
Maybe try adding something in there to test if the width & height
(img.width & img.height) are actually set when the script is trying to
do its job... If it's only on the rollovers, that would be my guess...
Aug 1 '05 #5
Justin Koivisto wrote:
Just guessing, but I'd bet it has to do with the width & hight actually
being set to 0 instead of what it should be... Doing that cause MSIE to
not show the image at all as if it was never there to begin with...
Maybe try adding something in there to test if the width & height
(img.width & img.height) are actually set when the script is trying to
do its job... If it's only on the rollovers, that would be my guess...


I wrote the exact width and height instead of vars and nothing changed.
W3C guide says that the <span> tag can manage onmouseover and similar
event properties, so i tried but it didn't work. Any suggestion about
how to re-write the strNewHTML var? For sure i'm not a jscript expert
but i think that the hack is in make that var manage events.
Aug 2 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1950
by: Leythos | last post by:
I've got several sites that I used DreamWeaver MX to add RollOver buttons to the pages, it also adds some javascript that pre-loads the images and does the mouse_over and such. In FireFox 1.0.1 when I load the page and it pre-loads the images the status bar shows DONE. When I mouse over any item, it changes the image properly, but the status (lower left of browser) shows "Read www.somesite.com", it may also show "Waiting for...
5
5175
by: jedbob | last post by:
I used Adobe Imageready to build a simple rollover navigation bar, where the text will change color on a mouse over. The working example can be found at: http://www.akujunkan.com/test/NavBar.html However, when I try to incorporate the javascript and code into another table, the rollover stops working: http://www.akujunkan.com/test/index.html
3
2710
by: JOSEPHINE ALVAREZ | last post by:
I have this code that I want to use to do a rollover. However, because the company I am doing it for is continually changing the text, I want to be able to use dynamic text to change the text on the fly, and still have the rollover work. I have taken the text off of the buttons, but cannot figure out how to do it with dynamic text using javascript and html. For example, in the columns of this row, I want to put "About...
47
7598
by: Lauren Quantrell | last post by:
I have constructed the following code that simulates the common rollover effect when moving the mouse over a label (this example makes the label bold.) I'm wondering if anyone has come up with a better solution. lq 'start code:
3
1466
by: Rob R. Ainscough | last post by:
Just curious why a VERY commonly used affect of rollover was NOT implemented in .NET 2.0 for web controls? Does anyone have a link to VB code that will show me how to build my own UserControl that will support a rollover? thanks, Rob.
2
3438
by: Casimir | last post by:
I am looking into making pure CSS image rollovers. Do you have any clever (and robust) CSS rollover-tricks? Or links to such "in the wild"? I have figured out two methods for this, but have yet to do proper testing on browser support. Method I:
3
2727
by: Oriane | last post by:
Hi there, I would like to handle a "rollover" <asp:Buttonin the code behind with C# with this kind of code: Button btn = Page.FindControl("Button" + numWidget) as Button; btn.Attributes = "document.all." + btn.ClientID + ".src = '/Images/blue.gif'";
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8525
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.