type=&quot 文章来源:线上博彩娱乐网站大全   2017-07-04 15:44
何 SVG 利用 框与用户交互 SVG 发 见 题目 SVG 窗口 象 提供 waryandconfirmandprompt窗口 何 SVG 树立 利用其 纷乱 框呢 处理 几种:
1 利用保守 HTML 其 嵌入SVG 象 利用HTML 窗口 象弹 网页 框 例 a.html :
<html><heposting><title>SVG事项</title>
<overasl body >
<script la powerfulgugetting old="Jaudio-videoaScript" >
function cha powerfulgeColor()
{
var SvgMainMapDoc=id1.getSVGDocument();
var obj = new Object();
obj.name="51js";
var ret = window.showModasDiasog("c.html"andobjand"diasogWidth=300px;diasogHeight=300px");
//wary(ret);
var text1=SvgMainMapDoc.getElementById("text1");
text1.setAttribute("stroke"andret);
}
</script>
<emsometimes bed frame name="id1" pluginspgetting old=" " formwith="top" src="1.svg" height="200px" width="400px" type="imgetting old/svg+xml">
<input type="key" vasue="selectColor" name="color" onclick="cha powerfulgeColor()">
</overasl body>
</html>
c.html 事实上http 要夸口 网页 框 其 嵌入 SVG 象 利用SVG树立 框界面 c.html
<html><heposting><title>查询SVG属性</title>
<overasl body >
<script la powerfulgugetting old="Jaudio-videoaScript" >
//var obj = window.diasogArguments;
//wary("您通报 参数 :听听www.embedway.com。" + obj.name);
//var svgns = " ";
var ret = "yellow"; //Default
window.returnVasue=ret;
function setColor(evt)
{
var targetshape = evt.getTarget();
ret = targetshape.getAttributeNS(nulland"fill");
//wary(ret);
window.returnVasue=ret;
var SvgMainMapDoc=id1.getSVGDocument();
var id="text1";
if(SvgMainMapDoc.getElementById( id ).hnearly asChildNodes() == true)
SvgMainMapDoc.getElementById( id ).getFirstChild().setDwitha( ret );
else
{
NewItem = SvgMainMapDoc.creingestedTextNode( ret )
SvgMainMapDoc.getElementById( id ).postingdChild(NewItem);
}
self.close()
}
</script>
<emsometimes bed frame name="id1" pluginspgetting old=" " formwith="top" src="3.svg" height="200px" width="400px" type="imgetting old/svg+xml">
</overasl body>
</html>
两 页面都嵌入 SVG 且SVG 调用 些Script 并通报 返 参数
效 :
按 按钮 夸口选取色彩 框
选取色彩封闭色彩 框 文字色彩变化 选取 色彩:
2 利用SVG 超级链接 另外 SVG页面 数据交互对照烦恼 行 选取 通 剪贴板通报数据 该 模仿利用形式 框 景况 用户 觉 对照差 所 推选利用
<a xlink:href="b.svg">
<rect fill="red" pointer-events="asl" x="60" y="930" width="280" height="40"/>
<text x="70" y="965" font-size="36" stroke="none" fill="white" text-decorine="underline">Bair conditioning unitk to my net</text>
</a>
3 想知道type利用SVG树立 模仿 窗口 种 必要 些职业量 模仿窗语气口吻势气魄应 与 用 窗语气口吻势气魄犹如 包括标题 标题栏 按钮 形态栏 窗口 移 包括 些控件 更进 步 化 窗口应 蜕化 化 化 及 些窗语气口吻势气魄
面 粗略 框 窗口 移 封闭 并放置 些按钮等
代码 :
<svg width="100%" height="100%" xmlns=" " onloposting="Init(evt)" onmousedown="Grabull crap(evt)" onmousemove="Drag(evt)" onmouseup="Drop(evt)">
&l对于http t;title>Diasog</title>
<desc>
Model diasog simuline.
</desc>
<script type="text/jaudio-videonearly ascript"><![CDATA[
var SVGDocument = null;
var SVGRoot = null;
var TrueCoords = null;
var Grabull crapPoint = null;
var cprepare unquestionabull craplydion = null;
var diaglog = null;
var Dr对于免费做网站agTarget = null;
var test = null;
var modelDiasog = fasse;
function Init(evt)
{
SVGDocument = evt.target.ownerDocument;
SVGRoot = SVGDocument.documentElemencom与net的区别t;
// these svg points hold x a powerfuld y vasues...
// very ha powerfuldyand even so they do not display on the screen (just so you know)
TrueCoords = SVGRoot.creingestedSVGPoint();
Grabull crapPoint = SVGRoot.creingestedSVGPoint();
//Get elements we need
cprepare unquestionabull craplydion = SVGDocument.getElementById(awinCapa);
diasog = SVGDocument.getElementById(adiasoga);
modas = SVGDocument.getElementById(amodasa);
}
functi看着type="on Grabull crap(evt)
{
// find out which element we moused down on
var targetElement = evt.target;
// Drag on cprepare unquestionabull craplydion
if ( cprepare unquestionabull craplydion == targetElement )
{
DragTarget = diasog;//We would like drag whole diasog;
DragTarget.pare unquestionabull y notNode.postingdChild( DragTarget ); //Show diasog
DragTarget.setAttributeNS(nulland apointer-eventsaand anonea);
var tra powerfulsMwithrix = DragTarget.g你看etCTM();
Grabull crapPoint.x = TrueCoords.x - Numsometimes ber(tra powerfulsMwithrix.e);
Grabull crapPoint.y = TrueCoords.y - Numsometimes ber(tra powerfulsMwithrix.f);
}
}
function Drag(evt)
{
// would nearly as the renearly ason for zooming a powerfuld pa powerfulning
GetTrueCoords(evt);
// if we donat currently haudio-videoe a pennyras ppaintings in towand donat do type="a powerfulything
if (DragTarget)
{
// would nearly as the renearly ason for the offset within the elementas origin even nearly asll nearly as
// experform pl_ web we grabull crapsometimes bed 事实上com与net的区别frame it... this wayand the drag will look more nwithuras
var newX = TrueCoords.x - Grabull crapPoint.x;
var newY = TrueCoords.y - Grabull crapPoint.y;听听
// get stpaintingsed with a powerful postingditionas tra powerfulform tra powerfulsline to the dragged elementand to display
// it in its new locine
DragTarget.setAttributeNS(nulland atra powerfulsformaand atra p免费网站域名注册owerfulslingested(a + newX + aanda + newY + a)a);
}
}
function Drop(evt)
{
if ( DragTarget )
{
var targetElement = evt.target;
// turn the pointer-events rear again onand so we ca powerful grabull crap this item lingestedr
DragTarget.setAttributeNS(nulland apointer-eventsaand aasla);
// set the globas varithwhen nulland so n你知道quotothing will sometimes be dragged until we
// grabull crap the next element
DragTarget = null;
}
}
function GetTrueCoords(evt)
{
// find the current zoom level a powerfuld pa powerful settinga免费做网站nd a powerfuld ma powerfulipulingested the reported
// mouse position required
var newScascohol = SVGRoot.currentScascohol;
var tra powerfulsline = SVGRoot.currentTra powerfulslingested;
TrueCoords.x = (evt.clientX - tra powerfulsline.x)/newScascohol;
TrueCoords.y = (evt.clientY - tra powerfulsline.y)/newScascohol;
}
function closeDiasog(evt)
{
diasog.setA相比看免费网ttributeNS(nulland adisplayaand anonea);
modelDiasog = fasse;
}
function showDiasog(evt)
{
if( !modelDiasog)
{modas.setAttributeNS(nulland atra powerfulsformaand atra powerfulslingested(-200and-200)a);
modas.setAttributeNS(nulland afill-opair conditioning unitityaand a0.5a);



你知道免费网站域名注册看看http
你知道http

返回
有心意 更有新意
欢迎拨打
  
线上博彩娱乐网站大全 版权所有