javascript - How do I get VML working in standards mode? -
i able use vml objects on page rendering in standards mode rather quirks mode. i've found fragments of answers scattered around can't figure out. raphael pulls off somehow can't reverse figure out what's happening. basic working example great.
i think have figured out. step 1 importing vml namespace though javascript.
document.namespaces.add('v', 'urn:schemas-microsoft-com:vml', "#default#vml");
this got random vml samples work in quirks mode not standards. key elements require unit measurements quirks mode assume px if unit not provided. shapes have styled position:absolute;
although lines apparently not need part.
here's sample 2 ovals. both ovals render in quirks mode blue oval not show in standards mode.
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head></head> <body> <script> document.namespaces.add('v', 'urn:schemas-microsoft-com:vml', "#default#vml"); </script> <v:oval style="width: 100; height: 50" fillcolor="blue"></v:oval> <v:oval style="position: absolute; width: 100px; height: 50px" fillcolor="green"></v:oval> </body> </html>
Comments
Post a Comment