Flash+XML焦点图的制作方法
近期要做个网站,需要用到Flash+XML焦点图切换技术(就是各大新闻网站常见的那种),催的很急8号就要用,我打算用周末2天的时间把这个技术掌握。但是我没学过AS和XML...
近期要做个网站,需要用到Flash+XML焦点图切换技术(就是各大新闻网站常见的那种),催的很急8号就要用,我打算用周末2天的时间把这个技术掌握。但是我没学过AS和XML,也不会编程。该怎么办啊。
网上下的文件一大串AS代码,看的想吐,难道就没什么简单的方法吗。不求多华丽,只要实现效果就可以。 展开
网上下的文件一大串AS代码,看的想吐,难道就没什么简单的方法吗。不求多华丽,只要实现效果就可以。 展开
2个回答
展开全部
给你一个我常用的JS脚本吧。
调用语句:
<div id="lad">
<script type="text/javascript" src="flash.js"></script>
</div>
同时要设置好lad的样式,主要要设置好宽度,然后图片的高度会自动按比例缩放的。
flash.js的内容:
//图片滚动展示 Start
//counts为显示数量//
var counts = 5;
//大图//
img1 = new Image();
img1.src = 'images/lad-1.gif';
img2 = new Image();
img2.src = 'images/lad-2.gif';
img3 = new Image();
img3.src = 'images/lad-3.gif';
img4 = new Image();
img4.src = 'images/lad-4.gif';
img5 = new Image();
img5.src = 'images/lad-5.gif';
var smallImg = new Array();
//小图
smallImg[0] = 'images/smallimg1.gif';
smallImg[1] = 'images/smallimg2.gif';
smallImg[2] = 'images/smallimg3.gif';
smallImg[3] = 'images/smallimg4.gif';
smallImg[4] = 'images/smallimg5.gif';
//链接地址
url1 = new Image();
url1.src = '1.html';
url2 = new Image();
url2.src = '2.html';
url3 = new Image();
url3.src = '3.html';
url4 = new Image();
url4.src = '4.html';
url5 = new Image();
url5.src = '5.html';
//alt值
alt1 = new Image();
alt1.alt = 'alt信息';
alt2 = new Image();
alt2.alt = 'alt信息';
alt3 = new Image();
alt3.alt = 'alt信息';
alt4 = new Image();
alt4.alt = 'alt信息';
alt5 = new Image();
alt5.alt = 'alt信息';
var nn = 1;
var key = 0;
function change_img() {
if (key == 0) {
key = 1;
} else if (document.all) {
document.getElementById("pic").filters[0].Apply();
document.getElementById("pic").filters[0].Play(duration = 2);
}
eval('document.getElementById("pic").src=img' + nn + '.src');
eval('document.getElementById("url").href=url' + nn + '.src');
eval('document.getElementById("pic").alt=alt' + nn + '.alt');
if (nn == 1) {
document.getElementById("url").target = "_blank";
document.getElementById("url").style.cursor = "pointer";
} else {
document.getElementById("url").target = "_blank"
document.getElementById("url").style.cursor = "pointer"
}
for ( var i = 1; i <= counts; i++) {
document.getElementById("xxjdjj" + i).className = 'axx';
}
document.getElementById("xxjdjj" + nn).className = 'bxx';
nn++;
if (nn > counts) {
nn = 1;
}
tt = setTimeout('change_img()', 10000);
}
function changeimg(n) {
nn = n;
window.clearInterval(tt);
change_img();
}
function ImageShow() {
document.write('<div class="picshow_main">');
document.write('<div><a id="url"><img id="pic" class="imgbig" /></a></div>');
document.write('<div class="picshow_change">');
for ( var i = 0; i < counts; i++) {
document.write('<a href="javascript:changeimg(' + (i + 1)
+ ');" id="xxjdjj' + (i + 1)
+ '" class="axx" target="_self"><img src="' + smallImg[i]
+ '"></a>');
}
document.write('</div></div>');
change_img();
}
//图片滚动展示 End
ImageShow();
调用语句:
<div id="lad">
<script type="text/javascript" src="flash.js"></script>
</div>
同时要设置好lad的样式,主要要设置好宽度,然后图片的高度会自动按比例缩放的。
flash.js的内容:
//图片滚动展示 Start
//counts为显示数量//
var counts = 5;
//大图//
img1 = new Image();
img1.src = 'images/lad-1.gif';
img2 = new Image();
img2.src = 'images/lad-2.gif';
img3 = new Image();
img3.src = 'images/lad-3.gif';
img4 = new Image();
img4.src = 'images/lad-4.gif';
img5 = new Image();
img5.src = 'images/lad-5.gif';
var smallImg = new Array();
//小图
smallImg[0] = 'images/smallimg1.gif';
smallImg[1] = 'images/smallimg2.gif';
smallImg[2] = 'images/smallimg3.gif';
smallImg[3] = 'images/smallimg4.gif';
smallImg[4] = 'images/smallimg5.gif';
//链接地址
url1 = new Image();
url1.src = '1.html';
url2 = new Image();
url2.src = '2.html';
url3 = new Image();
url3.src = '3.html';
url4 = new Image();
url4.src = '4.html';
url5 = new Image();
url5.src = '5.html';
//alt值
alt1 = new Image();
alt1.alt = 'alt信息';
alt2 = new Image();
alt2.alt = 'alt信息';
alt3 = new Image();
alt3.alt = 'alt信息';
alt4 = new Image();
alt4.alt = 'alt信息';
alt5 = new Image();
alt5.alt = 'alt信息';
var nn = 1;
var key = 0;
function change_img() {
if (key == 0) {
key = 1;
} else if (document.all) {
document.getElementById("pic").filters[0].Apply();
document.getElementById("pic").filters[0].Play(duration = 2);
}
eval('document.getElementById("pic").src=img' + nn + '.src');
eval('document.getElementById("url").href=url' + nn + '.src');
eval('document.getElementById("pic").alt=alt' + nn + '.alt');
if (nn == 1) {
document.getElementById("url").target = "_blank";
document.getElementById("url").style.cursor = "pointer";
} else {
document.getElementById("url").target = "_blank"
document.getElementById("url").style.cursor = "pointer"
}
for ( var i = 1; i <= counts; i++) {
document.getElementById("xxjdjj" + i).className = 'axx';
}
document.getElementById("xxjdjj" + nn).className = 'bxx';
nn++;
if (nn > counts) {
nn = 1;
}
tt = setTimeout('change_img()', 10000);
}
function changeimg(n) {
nn = n;
window.clearInterval(tt);
change_img();
}
function ImageShow() {
document.write('<div class="picshow_main">');
document.write('<div><a id="url"><img id="pic" class="imgbig" /></a></div>');
document.write('<div class="picshow_change">');
for ( var i = 0; i < counts; i++) {
document.write('<a href="javascript:changeimg(' + (i + 1)
+ ');" id="xxjdjj' + (i + 1)
+ '" class="axx" target="_self"><img src="' + smallImg[i]
+ '"></a>');
}
document.write('</div></div>');
change_img();
}
//图片滚动展示 End
ImageShow();
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询