Wer die offizielle ExplorerCanvas Version einsetzt, sollte bald gezwungen sein, diese upzudaten, da diese Version aus dem Jahr 2007 nicht den Windows Internet Explorer 8 im Standard-Modus unterstützt. Abhilfe schafft die aktuelle Revision 44 aus dem excanvas subversion repository.
Leider unterstützt diese Version wiederum nicht das dynamische Erstellen von canvas-Elementen. Abhilfe verschafft die Methode fixElement_, welche leider zugunsten des createElement-Workarounds gestrichen wurde. Eine Erweiterung der aktuellen excanvas-Revision, um wieder dynamisch kreierte canvas-Elemente im IE fixen zu können, könnte wie folgt aussehen:
//alte fixElement_-Methode aus Rev 26
G_vmlCanvasManager.fixElement_ = function (el) {
// in IE before version 5.5 we would need to add HTML: to the tag name
// but we do not care about IE before version 6
var outerHTML = el.outerHTML;
var newEl = el.ownerDocument.createElement(outerHTML);
// if the tag is still open IE has created the children as siblings and
// it has also created a tag with the name "/FOO"
if (outerHTML.slice(-2) != "/>") {
var tagName = "/" + el.tagName;
var ns;
// remove content
while ((ns = el.nextSibling) && ns.tagName != tagName) {
ns.removeNode();
}
// remove the incorrect closing tag
if (ns) {
ns.removeNode();
}
}
el.parentNode.replaceChild(newEl, el);
return newEl;
};
//Verknüpfung zwischen fixElement_- und initElement-Methode
G_vmlCanvasManager.fixDynamicElement = function(el){
return G_vmlCanvasManager.initElement(G_vmlCanvasManager.fixElement_(el));
};
Hiermit kann dann einfach das canvas-Element mit der Methode fixDynamicElement gefixt werden:
//... canvasElement = G_vmlCanvasManager.fixDynamicElement(canvasElement); //...
Ein Update lohnt in jedem Fall. Die Revision scheint nicht nur recht stabil zu sein, sondern enthält viele gute Bugfixes.
Hinweis: Inzwischen gibt es ein offizielles Release (3.) auf Grundlage der Revision 48. Das Projekt wird nun bei Google Code weiter vorangetrieben. Der oben genannte Fix für das dynamische Hinzufügen von Canvas-Elementen scheint aber weiterhin nötig zu sein
.
Hi !
I love your Media Queries script and I really want to use it in my project however I was wondering whether its possible for you to also include the “height” parameter.
The reason ?
Well width is a great but I had setup “min-width: 1280px” and “max-width: 1279px” etc Problem is that at 1280 you have multiple heights i.e. 1280×720 1280×768 1280×800 1280×960 and 1280×1024
Would be great if could also have a height parameter so can ensure correct stylesheet ?
i.e. “only screen and (min-width: 1280px) and (min-height: 1024)”
Is this possible? Thanks!
Andy
Comment by Andy — February 22, 2009 @ 5:46 pm
yes, this would be possible, but by now I´m very busy, so I can´t do this. Can you fill a feature request to the mediaqueries plugin @ http://plugins.jquery.com/project/MediaQueries (You have to be loggedin).
regards
Alex
Comment by alex@work — February 28, 2009 @ 4:33 am
moinmoin, obwohl dein script bei mir nicht funktioniert (liegt sicher an mir) finde ich die idee spitze und wäre auch an einer weiterentwicklung in richtung andys ansatz interessiert…
danke für’s kostenlose!
torsten
Comment by torsten — April 9, 2010 @ 7:48 pm