用图片更改文字 [英] Changing text with picture
问题描述
我使用以下代码在团队中显示褪色图片
网站。有人可以告诉我如何修改它,以便我可以在图片更改时显示每个员工的姓名吗?这不是页面的完整代码,而只是与我在这里询问的代码相关的代码。一些背景信息:页面设置
使用布局表格,图片显示在布局单元格中。我想要任何帮助。
感谢您的帮助。
< HTML>
< HEAD>
< SCRIPT LANGUAGE =" JavaScript"> ;
<! - 原文:CodeLifter.com(su*****@codelifter.com) - >
<! - 网站: http://www.codelifter.com - >
//设置slideShowSpeed(毫秒)
var slideShowSpeed = 5000;
//交叉淡入淡出的持续时间(秒)
var crossFadeDuration = 3;
//指定图像文件
var Pic = new Array();
//添加更多图像,继续
//模式,添加到下面的数组
Pic [0] =''images / stepanie.jpg''
Pic [1] =''images / leslie.jpg''
Pic [2] =''images / nate.jpg''
Pic [3] =''images / jeff.jpg''
Pic [4] =''images / vincent.jpg''< br $>
//不要编辑此行以下的任何内容
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for(i = 0;我<磷; i ++){
preLoad [i] = new Image();
preLoad [i] .src = Pic [i];
}
函数runSlideShow(){
if(document.all){
document.images.SlideShow.style.filter =" blendTrans( duration = 2)" ;;
document.images.SlideShow.style.filter =" blendTrans(duration = crossFadeDuration)" ;;
document.images.SlideShow。 filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad [j] .src;
if( document.all){
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
如果(j(p - 1))j = 0;
t = setTimeout(''runSlideShow()'',slideShowSpeed);
}
< / script>
< / HEAD>
< BODY onLoad =" runSlideShow()" ;>
< table border =" 0" CELLPADDING = QUOT; 0" cellspacing =" 0">
< tr>
< td id =" VU" height = 150 width = 150>
< img src =" 1.jpg" name ='''SlideShow''width = 150 height = 150>
< / td>
< / tr>
< / table>
< p>< center>
< b>
< font face =" arial,helvetica尺寸" -2"> BOA Bombers< / font>
< / b>
< / center>< p>
< / BODY>
< / HTML>
Anthonyaécrit:
我使用以下代码在团队中显示淡化图片
网站。
这只会在PC上运行IE赢: - (
告诉我,如果这个
http://perso.orange.fr/stephane.mori ... _img_slide.htm
适用于您的IE
有人可以告诉我如何修改它以便我可以显示
图片更改时每位员工的姓名?
优先,员工人数:
var employees = [" Dupont",Smith,Mc O''Brian,Gary,Roberto];
显示新图片,你在innerHTML名称
document.getElementById(''employee'')。innerHTML = employees [x];
这不是页面的
完整代码,只有与我相关的代码
问这里一些背景信息:页面设置
使用布局表格,图片显示在布局单元格中。我想要任何帮助。
感谢您的帮助。
< HTML>
< HEAD>
< SCRIPT LANGUAGE =" JavaScript"> ;
<! - 原文:CodeLifter.com(su*****@codelifter.com) - >
<! - 网站: http://www.codelifter.com - >
//设置slideShowSpeed(毫秒)
var slideShowSpeed = 5000;
//交叉淡入淡出的持续时间(秒)
var crossFadeDuration = 3;
//指定图像文件
var Pic = new Array();
//添加更多图像,继续
//模式,添加到下面的数组
Pic [0] =''images / stepanie.jpg''
Pic [1] =''images / leslie.jpg''
Pic [2] =''images / nate。 jpg''
Pic [3] =''images / jeff.jpg''
Pic [4] =''images / vincent.jpg''
var employees = [" Dupont",Smith,Mc O''Brian,Gary,Roberto];
//不要编辑此行以下的任何内容
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for(i = 0;我<磷; i ++){
preLoad [i] = new Image();
preLoad [i] .src = Pic [i];
}
函数runSlideShow(){
if(document.all){
document.images.SlideShow.style.filter =" blendTrans( duration = 2)" ;;
document.images.SlideShow.style.filter =" blendTrans(duration = crossFadeDuration)" ;;
document.images.SlideShow。 filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad [j] .src;
document.getElementById(''employee'')。innerHTML = employees [j];
if(document.all){
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1 ;
if(j(p - 1))j = 0;
t = setTimeout(''runSlideShow()'',slideShowSpeed);
}
< / script>
< / HEAD>
< BODY onLoad = " runSlideShow()">
< table border =" 0" CELLPADDING = QUOT; 0" cellspacing =" 0">
< tr>
< td id =" VU" height = 150 width = 150>
< img src =" 1.jpg" name ='''SlideShow''width = 150 height = 150>
< br>
< span id =" employee">< / span>
< / td>
< / tr>
< / table>
< p>< center>
< b>
< font face =" arial,helvetica"尺寸" -2"> BOA Bombers< / font>
< / b>
< / center>< p>
< / BODY>
< / HTML>
-
Stephane Moriaux et son(moins)vieuxMacdéjàdépassé
" ASM" < st ********************* @ wanadoo.fr.invalidwrote in message
news:45 ******* *************** @ news.orange.fr ...
Anthonyaécrit:
>我使用以下代码在团队
网站上显示淡化图片。
这只会在PC上运行IE赢: - (
告诉我,如果这个
http://perso.orange.fr/stephane.mori ... _img_slide.htm
适用于您的IE
这在Internet Explorer 6或Opera 9中不起作用.Firefox似乎尽管如此。
-Lost
- 失去一个écrit:
" ASM"< st ********************* @ wanadoo.fr.invalidwrote in message
news: 45 ********************** @ news.orange.fr ...
> >
告诉我这是否
http://perso.orange.fr/stephane.mori..._img_slide.htm
适用于你的IE
那不是在Internet Explorer 6或Opera 9中工作。但Firefox似乎很喜欢它。
不明白:
它适用于我的FF 2,Safari 1.3,甚至是Opera 9
>
我的IE Mac确实无法正常工作。
(关于计时很难理解的东西?)
但是我不知道我对IE Windows做错了什么。
难道他不明白''onload''带图像吗?
var I =新图像()
I.onload = function(){alert(''loaded''); }
I.src =''myImage.jpg'';
试图修复它:
http://perso.orange.fr/stephane.mori...g_slide_ie.htm
但这里的变量是全球的
我觉得它对IE的内存不是一个好主意吗?
-
Stephane Moriaux et son(moins)vieuxMacdéjàdépassé
Stephane Moriaux和他的(较少)旧Mac已经过时
I am using the following code to display fading pictures on a team
website. Can someone show me how to modify it such that I can display
the names of each employee when the picture changes? This is not the
complete code for the page but only the code relevant to what I am
asking here. Some background information for you: the page is set up
using a layout table and the pictures are displayed in a layout cell.I
appreciate any help.
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: CodeLifter.com (su*****@codelifter.com) -->
<!-- Web Site: http://www.codelifter.com -->
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = ''images/stepanie.jpg''
Pic[1] = ''images/leslie.jpg''
Pic[2] = ''images/nate.jpg''
Pic[3] = ''images/jeff.jpg''
Pic[4] = ''images/vincent.jpg''
// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans (duration=2)";
document.images.SlideShow.style.filter="blendTrans (duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply ();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play( );
}
j = j + 1;
if (j (p - 1)) j = 0;
t = setTimeout(''runSlideShow()'', slideShowSpeed);
}
</script>
</HEAD>
<BODY onLoad="runSlideShow()">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="VU" height=150 width=150>
<img src="1.jpg" name=''SlideShow'' width=150 height=150>
</td>
</tr>
</table>
<p><center>
<b>
<font face="arial, helvetica" size"-2">The BOA Bombers</font>
</b>
</center><p>
</BODY>
</HTML>
Anthony a écrit :I am using the following code to display fading pictures on a team
website.That will only run With IE on PC Win :-(
Tell me if this
http://perso.orange.fr/stephane.mori..._img_slide.htm
works with your IE
Can someone show me how to modify it such that I can display
the names of each employee when the picture changes?first, array of employees :
var employees = ["Dupont","Smith","Mc O''Brian","Gary","Roberto"];
as soon as the new picture is displayed, you innerHTML the name
document.getElementById(''employee'').innerHTML = employees[x];
This is not the
complete code for the page but only the code relevant to what I am
asking here. Some background information for you: the page is set up
using a layout table and the pictures are displayed in a layout cell.I
appreciate any help.
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: CodeLifter.com (su*****@codelifter.com) -->
<!-- Web Site: http://www.codelifter.com -->
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = ''images/stepanie.jpg''
Pic[1] = ''images/leslie.jpg''
Pic[2] = ''images/nate.jpg''
Pic[3] = ''images/jeff.jpg''
Pic[4] = ''images/vincent.jpg''var employees = ["Dupont","Smith","Mc O''Brian","Gary","Roberto"];
// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans (duration=2)";
document.images.SlideShow.style.filter="blendTrans (duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply ();
}
document.images.SlideShow.src = preLoad[j].src;document.getElementById(''employee'').innerHTML = employees[j];
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play( );
}
j = j + 1;
if (j (p - 1)) j = 0;
t = setTimeout(''runSlideShow()'', slideShowSpeed);
}
</script>
</HEAD>
<BODY onLoad="runSlideShow()">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="VU" height=150 width=150>
<img src="1.jpg" name=''SlideShow'' width=150 height=150><br>
<span id="employee"></span>
</td>
</tr>
</table>
<p><center>
<b>
<font face="arial, helvetica" size"-2">The BOA Bombers</font>
</b>
</center><p>
</BODY>
</HTML>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
"ASM" <st*********************@wanadoo.fr.invalidwrote in message
news:45**********************@news.orange.fr...Anthony a écrit :>I am using the following code to display fading pictures on a team
website.
That will only run With IE on PC Win :-(
Tell me if this
http://perso.orange.fr/stephane.mori..._img_slide.htm
works with your IEThat does not work in Internet Explorer 6 or Opera 9. Firefox seems to enjoy it though.
-Lost
-Lost a écrit :"ASM" <st*********************@wanadoo.fr.invalidwrote in message
news:45**********************@news.orange.fr...>>
Tell me if this
http://perso.orange.fr/stephane.mori..._img_slide.htm
works with your IE
That does not work in Internet Explorer 6 or Opera 9. Firefox seems to enjoy it though.Do not understand :
it works fine with my FF 2, Safari 1.3, and even Opera 9
With my IE Mac indeed that doesn''t work.
(something to much hard to understand about timing ?)
However I don''t know what I did wrong about IE Windows.
Doesn''t he understand ''onload'' with image ?
var I = new Image()
I.onload = function() { alert(''loaded''); }
I.src = ''myImage.jpg'';
Tried to fix it :
http://perso.orange.fr/stephane.mori...g_slide_ie.htm
but variables here are global
and I think it''s not a good idea for IE''s memory ?
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
这篇关于用图片更改文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!