IE 8로 작업하면서 javascript를 통해 내 페이지에 두 개의 VML 타원 (A, B)을 추가하려고합니다. 어느 쪽의 타원도 부모 DIV에 추가되지만 두 번째는 렌더링되지 않습니다.IE8에서 JavaScript를 통해 여러 VML 요소 추가하기
내가 appendChild (A)를 누른 다음 appendChild (B)를 실행하면 타원형 A가 렌더링되고 B는 렌더링되지 않습니다. appendChild (B)에 appendChild (A)를 지정하면 타원형 B가 렌더링되고 A는 렌더링되지 않습니다.
document.namespaces.add("v","urn:schemas-microsoft-com:vml");
this.container = Document.getElementById(mydiv);
var grid2 = document.createElement("v:oval");
grid2.style.left= "300px";
grid2.style.top= "250px";
grid2.style.width= "25pt";
grid2.style.height= "75pt";
grid2.style.position="absolute";
grid2.style.behavior="url(#default#VML)";
grid2.style.display="inline-block";
grid2.setAttribute("fillcolor","#FF0000");
grid2.setAttribute("id", "marker2");
var grid = document.createElement("v:oval");
grid.style.left="100px";
grid.style.top="100px";
grid.style.width="94pt";
grid.style.height="164pt";
grid.style.position="absolute";
grid.style.behavior="url(#default#VML)";
grid.style.display="inline-block";
grid.setAttribute("fillcolor","#0000FF");
grid.setAttribute("id", "marker");
this.container.appendChild(grid2);
this.container.appendChild(grid);
VML 추가에 대한 몇 가지 트릭이 누락 되었습니까?
IE 9에서 동일한 결과를 시도했습니다.
기업 규칙으로 인해 회사 내에서 IE 만 지원되며 많은 사용자가 여전히 IE8을 사용하고 있으므로 현재 HTML5 캔버스를 전환 할 수 없습니다. 어떤 제안
왜 [Raphaël] (http://raphaeljs.com/)을 사용하지 않습니까? 이것에는 * 많은 * 더 깔끔한 API가 있습니다. IE (그리고 다른 브라우저의 경우 SVG)에 VML을 사용하므로 IE가 지원됩니다. – vcsjones
HTML 페이지의 doctype은 무엇입니까? IE에서 VML 렌더링에 중요한 차이가 있습니까? – David
나는 Raphael 라이브러리를보기 시작했다. DOCTYPE까지는 내가 가지고있는 것을 확인할 것입니다. David, 그리고 당신 말이 맞아요, 제 경험상 IE는 DOCTYPE과 다른 브라우저에 더 민감합니다. 빠른 제안에 감사드립니다. –