]> git.sesse.net Git - pr0n/blobdiff - files/pr0n-fullscreen.js
Fix IE opacity error in indexed mode.
[pr0n] / files / pr0n-fullscreen.js
index b709b5093972b3d5d8c834ff3bcd19ec262c43d0..857f3d9c27d654801199142459c933ea60a5277e 100644 (file)
@@ -82,7 +82,7 @@ function display_image(width, height, evt, filename, element_id)
                img.src = url;
        }
        
-       var main = document.getElementById("main");
+       var main = document.getElementById("iehack");
        main.appendChild(img);
 
        return img;
@@ -144,8 +144,13 @@ function set_opacity(id, amount)
                                elem.style.filter = "";
                        }
                        elem.style.filter += "alpha(opacity=" + (amount*100.0) + ")";
-               } else {
-                       elem.filters.alpha.opacity = (amount * 100.0);
+               } else {        
+                       // ugh? this seems to break in color index mode...
+                       if (typeof(elem.filters) == 'unknown') {
+                               elem.style.filter = "alpha(opacity=" + (amount*100.0) + ")";
+                       } else {
+                               elem.filters.alpha.opacity = (amount * 100.0);
+                       }
                }
        } else {                             // no alpha support
                if (amount > 0.5) {