当前位置:首页 > Js图片特效:图片幻灯片切换

Js图片特效:图片幻灯片切换

点击次数:1848  更新日期:2011-01-05
\n

利用js+flash,实现的图片幻灯片切换 效果显示:http://www.nr234.cn ,然后找几个图片换一下就可以了。


\n


\n

Js图片特效:图片幻灯片切换的代码如下:


\n

<!–焦点图开始 设计家园–>
<script type=”text/javascript” src=”/js/pic.js”></script>
<script language=”javascript” type=”text/javascript”>Maxz_LoadImg(’322′,’238′);</script>
<!–焦点图结束 http://www.dwww.cn–>


\n

放到网页上要显示的地方,Maxz_LoadImg 可以调整图片的大小,感觉好像还是等比例缩放的那种。


\n

pic.js原代码:


\n

function Maxz_LoadImg(w,h){
document.write(‘<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ id=”object_flash_player” codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0″ width=”‘+w+’” height=”‘+h+’”><param name=”movie” value=”/images/pic.swf”><param name=”quality” value=”high”><param name=”allowScriptAccess” value=”always”><param name=”allowFullScreen” value=”true”><param name=”FlashVars” value=”bcastr_xml_url=/js/pic.xml”><embed src=”/images/pic.swf” flashvars=”bcastr_xml_url=/js/pic.xml” quality=”high” pluginspage=”http://www.macromedia.com/go/getflashplayer” type=”application/x-shockwave-flash” allowfullscreen=”true” width=”‘+w+’” height=”‘+h+’”></object>’);
}
function selectTag(showContent,selfObj){
var tag = document.getElementById(“tags”).getElementsByTagName(“li”);
var taglength = tag.length;
for(i=0; i<taglength; i++){
tag[i].className = “”;
}
selfObj.parentNode.className = “selectTag”;
for(i=0; j=document.getElementById(“tagContent”+i); i++){
j.style.display = “none”;
}
document.getElementById(showContent).style.display = “block”;
}


\n

pic.xml存放的是图片的路径和链接址,


\n
<?xml version=”1.0″ encoding=”utf-8″ ?>

\n