var url = "http://" + global_vhost + "/" + evt + "/" + width + "x" + height + "/" + filename;
var img = document.getElementById(element_id);
if (img != null) {
- img.src = "";
+ img.src = "data:";
img.parentNode.removeChild(img);
}
img.src = url;
}
- var main = document.getElementById("main");
+ var main = document.getElementById("iehack");
main.appendChild(img);
return img;
// cancel any pending preload
var preload = document.getElementById("preload");
if (preload != null) {
- preload.src = "";
+ preload.src = "data:";
preload.parentNode.removeChild(preload);
}
-
- if (document.all) { // IE-specific
- img.onload = "display_image(" + width + "," + height + ",\"" + evt + "\",\"" + filename + "\",\"preload\");";
+
+ // grmf -- IE doesn't fire onload if the image was loaded from cache, so check for
+ // completeness first; should at least be _somewhat_ better
+ if (img.complete) {
+ display_image(width, height, evt, filename, "preload");
} else {
- img.onload = function() { display_image(width, height, evt, filename, "preload"); }
- }
+ img.onload = function() { display_image(width, height, evt, filename, "preload"); };
+ }
}
function relayout()
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) {
} else if (which == 27) { // escape
set_opacity("close", 0.7);
do_close();
- } else if (which == 32) { // space
+ } else if (which == 32 && global_select) { // space
select_image(global_image_list[global_image_num]);
}
}
var previous = document.getElementById("previous");
previous.outerHTML = "<span id=\"previous\" style=\"display: inline-block; position: absolute; bottom: 0px; right: 0px; width: 50px; height: 50px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + previous.src + "')\" onmousedown=\"if (can_go_previous()) set_opacity('previous', 1.0)\" onmouseup=\"if (can_go_previous()) { set_opacity('previous', 0.7); go_previous(); }\" onmouseout=\"if (can_go_previous()) { set_opacity('previous', 0.7); }\" />";
+
+ var close = document.getElementById("close");
+ close.outerHTML = "<span id=\"close\" style=\"display: inline-block; position: absolute; top: 0px; right: 0px; width: 50px; height: 50px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + close.src + "')\" onmousedown=\"set_opacity('close', 1.0)\" onmouseup=\"set_opacity('close', 0.7); do_close();\" onmouseout=\"set_opacity('close', 0.7);\" />";
}
}