-- 作者:kenvyboy
-- 发布时间:5/19/2008 11:26:00 AM
-- 各位大虾帮小弟看看代码怎么完善!!
<?xml version="1.0" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="640px" height="512px" viewBox="0 0 640 512" onload="init(evt) ; loop(100)"> <script type="text/ecmascript"><![CDATA[ var SVGDoc var delay = 0 var thisID; var nextID; var thisElem var nextElem var index=10; // initalize the SVG object - there can be multiple SVG objects on the page function init(thisEvent) { // determine SVG object SVGDoc = thisEvent.getTarget().getOwnerDocument() } function loop( timeDelay) { setTimeInterval(timeDelay) loopID= setInterval("anim()",delay) } function setTimeInterval(timeDelay) { if (! timeDelay) { delay = 2 } else { delay = parseInt(timeDelay) * 2 } } function anim() { thisID = "image"+index; if(index==18) { index=1 } else { index= index+1 } nextID= "image"+index; thisElem =SVGDoc.getElementById(thisID) nextElem = SVGDoc.getElementById(nextID) elemHide(thisElem) elemShow(nextElem) } // make an element visible function elemShow(elem) { thisStyle = elem.getStyle() // make the element visible thisStyle.setProperty('display', 'inline') } // hide an element function elemHide(elem) { thisStyle = elem.getStyle() // hide the element thisStyle.setProperty('display', 'none') function elemShow(elem) { thisStyle = elem.getStyle() // make the element visible document.menupic.filters[0].Apply(); document.all.menupic.src=imgpath; document.menupic.filters[0].Play(); //thisStyle.setProperty('display', 'inline') } } ]]></script> <g id="image1" name="menupic" display="none" style="FILTER: progid:DXImageTransform.Microsoft.Fade(duration=1.0,overlap=1.0)" > <image xlink:href="T1.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image2" display="none"> <image xlink:href="T2.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image3" display="none"> <image xlink:href="T2.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image4" display="none"> <image xlink:href="T3.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image5" display="none"> <image xlink:href="T3.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image6" display="none"> <image xlink:href="T4.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image7" display="none"> <image xlink:href="T4.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image8" display="none"> <image xlink:href="T5.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image9" display="none"> <image xlink:href="T5.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image10" display="none"> <image xlink:href="T6.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image11" display="none"> <image xlink:href="T6.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image12" display="none"> <image xlink:href="T7.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image13" display="none"> <image xlink:href="T7.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image14" display="none"> <image xlink:href="T8.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image15" display="none"> <image xlink:href="T8.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image16" display="none"> <image xlink:href="T9.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image17" display="none"> <image xlink:href="T9.jpg" x="0" y="0" width="640" height="512"/> </g> <g id="image18" display="none"> <image xlink:href="T1.jpg" x="0" y="0" width="640" height="512"/> </g> </svg> --------里面的T1 T2...是图片,现在还不能发,此代码的功能是图片连续播放,各位有什么更好的算法,使得播放更加连贯,在线=中!!
|