2011-09-13 9 views
11

कौन एक विचार या एक संकेतएम्बेड पैरामीटर

मैं इस पैरामीटर

HTML/एसवीजी मरने svg टैग के अंदर एक svg वस्तु एम्बेड और परिवर्तन करना चाहते हैं (पर नहीं जा रहा है) के साथ एक svg वस्तु

<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <title>Test</title> 
</head> 
<body> 
<svg width="2000" height="2000"> 
     <object type="image/svg+xml" data="lamp.svg" style="width: 450px; height:150px;"> 
      <param name="color" value="yellow" /> 
     </object> 
</svg> 
</body> 
</html> 

एसवीजी फ़ाइल lamp.svg:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="40" height="40"> 
<title>lamp</title> 
    <circle cx="30" cy="30" r="15" fill="param(color)" stroke-width=""/> 
</svg> 
छवि टैग के साथ

कोई टैग पैरामीटर गुजर possi है ble।

<image x="0" y="0" width="20" height="20" xlink:href="lamp.svg"><param name="color" value="yellow" /></image> 

उत्तर

11

वर्तमान ब्राउज़रों इस तरह से गुजर मानकों का समर्थन नहीं करते, हालांकि वहाँ एक SVG Parameters spec W3C द्वारा विकसित किया जा रहा। सुविधा के लिए समर्थन अनुकरण करने के लिए spec में उदाहरण a script का उपयोग करें।

नोट: शिम param.jsgoes in the SVG file, नहीं html फ़ाइल:

जैसे

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" 
width="68" height="68"> 
<rect x="10" y="10" height="48" width="48" stroke="black" stroke-width="1" fill="param(color) red"> 
</rect> 
<rect x="29" y="0" height="10" width="10" fill="black"></rect> 
<text x="24" y="46" fill="param(text) black" style="font-size:32px;" 
    content-value="param(number) 1">1</text> 

<script type="text/ecmascript" xlink:href="param.js" /> 

</svg> 
+1

2011 के बाद से इस में कोई भी परिवर्तन? –

+0

जहां तक ​​मुझे पता है, ब्राउजर के अनुसार कुछ भी नहीं बदला। –

+1

मैं svg एम्बेड करने वाले दस्तावेज़ में param मान कैसे निर्दिष्ट कर सकता हूं? स्क्रिप्ट केवल svg फ़ाइल में पैरा की तलाश करता है ... – kasi

संबंधित मुद्दे