㈠ 图片切换代码(html)网页
<SCRIPT language=JavaScript>
<!-- // BannerAD
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
改下面的图片地址和数量就行了
bannerAD[0]="1.gif";
bannerADlink[0]="#";
bannerAD[1]="2.gif";
bannerADlink[1]="#";
bannerAD[2]="3.gif";
bannerADlink[2]="#";
bannerAD[3]="4.gif";
bannerADlink[3]="#";
bannerAD[4]="5.gif";
bannerADlink[4]="#";
bannerAD[5]="1.gif";
bannerADlink[5]="#";
bannerAD[6]="1.gif";
bannerADlink[6]="#";
bannerAD[7]="1.gif";
bannerADlink[7]="#";
var preloadedimages=new Array();
for (i=0;i<bannerAD.length;i++){
preloadedimages=new Image();
preloadedimages.src=bannerAD;
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 3500);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</SCRIPT>
<A onmouseover="displayStatusMsg();return document.returnValue"
href="javascript:jump2url()"><IMG
style="FILTER: revealTrans(ration=2,transition=23)"
src="TungstenCore.files/1.jpg" border=0 name=bannerADrotator> </A>
<SCRIPT language=JavaScript>nextAd()</SCRIPT>
㈡ html点击按钮时切换图片的代码是什么
html点击按钮时切换图片的代码如下:
<scriptsrc="http://libs..com/jquery/2.1.4/jquery.min.js"></script>
<style>
#hello{width:108px;height:108px;border:1pxsolid#369;overflow:hidden;margin:auto;}
#word{margin:auto;width:136px;}
</style>
<divid="hello">
<imgsrc="http://i1..com/it/u=2390401277,3891827753&fm=203">
<imgsrc="http://i1..com/it/u=3713675608,2219355047&fm=203">
<imgsrc="http://i2..com/it/u=695011303,1300693603&fm=203">
</div>
<div>
<inputtype="button"value="上一张"onclick="a()";>
<inputtype="button"value="下一张"onclick="b()";>
</div>
<script>
functiona(){
$('#hello').find('img').eq(0).appendTo($('#hello'));
}
functionb(){
$('#hello').find('img:last').eq(0).prependTo($('#hello'));
}
</script>
㈢ 求HTML图片切换效果代码!
HTML是不能实现你想的那种效果的,要用js代码的,下面是我以前修改过的一个例子:<html>
<head>
<script type="text/javascript">
var theA=new Array(3);
for(i=0,n=theA.length;i<n;i++)
{theA[i]=new Image();<br> theA[i].src=i+'.jpg';}
var currentImage=1;
var run=true;
var speed=1000;
function changeSize1()
{
if(!document.images)
return;
if(!run)
return;
document.getElementById("myImage").src=theA[currentImage].src;
currentImage++;
if(currentImage>theA.length-1)
currentImage=0;
setTimeout('changeSize1()',speed);
}
</script>
</head>
<body onload="changeSize1()">
<img id="myImage" src="0.jpg" border="0" >
</body>
</html>里面是三张图面交换的,你可以修改,不清楚的就追问
㈣ 简单js 切换图片代码
详细出处参考: http://www.jb51.net/article/28383.htm 可以参考下
㈤ HTML中如何做图片切换效果,跪求代码
1、首先输入代码:
<div class="wrapper">
<div id="focus">
<ul>
<li><a href="http://www.lanrentuku.com/" target="_blank"><img src="img/01.jpg" alt="QQ商城焦点图效果下载" /></a></li>
㈥ 关于图片切换代码
可以啊.例如你电脑上有个a.html
在同一目录下有个图片a.jpg只要在a.html中插入 <img src=“a.jpg”就行了.注.以上代码不要复制.自己在英文输入法下写.
㈦ 图片切换代码,是怎样使用的
就放在你要显示这个的地方啊,把里面的addInfo("标题文字1","图片1URL","超链1URL");参数改为你自己的就行了
㈧ 求简单的图片切换代码
第一种:
把如下代码加入<body>区域中
<body onclick=Clicked()>
<SCRIPT>
<!--
transeffect = 0;
theeffects = new Array(24);
theeffects[0] = “盒状收缩“;
theeffects[1] = “盒状向外“;
theeffects[2] = “圆形收缩“;
theeffects[3] = “圆形向内“;
theeffects[4] = “从下向上“;
theeffects[5] = “从上向下“;
theeffects[6] = “从左向右“;
theeffects[7] = “从右向左“;
theeffects[8] = “百页窗形向右“;
theeffects[9] = “百页窗形向下“;
theeffects[10] = “棋盘形交叉向右“;
theeffects[11] = “棋盘形交叉向下“;
theeffects[12] = “随意溶解形“;
theeffects[13] = “左右向内“;
theeffects[14] = “左右向外“;
theeffects[15] = “上下向内“;
theeffects[16] = “上下向外“;
theeffects[17] = “条纹状向左下“;
theeffects[18] = “条纹状向左上“;
theeffects[19] = “条纹状向右下“;
theeffects[20] = “条纹状向右上“;
theeffects[21] = “溶解水平状“;
theeffects[22] = “溶解上下状“;
theeffects[23] = “随着溶解“;
current_image = “image1“;
function Clicked() {
var the_image, the_other;
text2.style.visiblity=“hidden“;
if (image1.style.visibility==“inherit“) {
the_image = image2;
the_other = image1;
}
else {
the_image = image1;
the_other = image2;
}
the_other.style.visibility=“hidden“;
the_image.filters.item(0).Apply();
the_image.filters.item(0).Transition = transeffect;
the_image.filters.item(0).Play(2.0);
the_image.style.visibility=“inherit“;
text2.innerText=theeffects[transeffect];
transeffect++;
if (transeffect == 24)
transeffect = 0;
text2.style.visibility=“visible“;
}
//-->
</SCRIPT>
<DIV id=image>
<DIV id=text1></DIV><IMG id=image1
src=“Upfiles/200422684962.gif“
style=“FILTER: revealTrans(Duration=3.0,Transition=1); VISIBILITY: hidden“> <IMG id=image2 src=“Upfiles/200422684962.gif“
style=“FILTER: revealTrans(Duration=3.0,Transition=1); VISIBILITY: hidden“> </DIV>
<DIV id=text2></DIV>
第二步:把<body>中的内容改为:
<body bgcolor=“#fef4d9“ onclick=Clicked()>
over feboy
第二种:
第一步、把下面这段代码插入到页面的<head>与</head>之间:
<script language=javascript>
isns = navigator.appName == "Netscape";
function ztstr(id,picurl,linkurl)
{
this.id=id
this.picurl=picurl
this.linkurl=linkurl
}
zhuanti=new Array()
imgcount=1;
frequency=10*1000;//30秒
//在这里修改图片的路径和链接
zhuanti[1]=new ztstr('1','http://www.windstudio.net/banner/banner1.gif','http://www.windstudio.net')
zhuanti[2]=new ztstr('2','http://www.windstudio.net/banner/banner2.gif','http://www.windstudio.net')
zhuanti[3]=new ztstr('3','http://www.windstudio.net/banner/banner3.gif','http://www.windstudio.net')
zhuanti[4]=new ztstr('4','http://www.windstudio.net/banner/banner4.gif','http://www.windstudio.net')
imgcount=zhuanti.length-1
for(i=1;i<=imgcount;i++)
{
eval_r("img"+i+"=new Image()")
eval_r("img"+i+".src=zhuanti["+i+"].picurl")
}
nn=1
var rand1 = 0;
var useRand = 0;
function swapPic() {
var imgnum = zhuanti.length - 1;
do {
var randnum = Math.random();
rand1 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand1 == useRand);
useRand = rand1;
// alert(useRand);
nn=useRand;
change_img();
}
function change_img()
{
eval_r('document.pic.src=img'+nn+'.src');
nn++;
if(nn>imgcount) nn=1
if(!isns)
{
pic.filters.item(0).apply()
pic.style.visibility='visible'
pic.filters.item(0).play()
setTimeout("pic.style.visibility='hidden'",frequency);
}
else
document.pic.visibility='visible'
tt=setTimeout('change_img()',frequency)
}
function pictarget()
{
tt=nn-1
if(tt<1) tt=imgcount
cururl=zhuanti[tt].linkurl
window.open(cururl);
}
function ini()
{
if(!isns)
{
spacewidth=Math.round((divmask.offsetWidth-770)/2)
dmwidth=770+spacewidth
dmheight=divmask.offsetHeight
totalstep=50
timeout=50
dmstepw=Math.round(770/totalstep)
dmsteph=Math.round(dmheight/totalstep)
setTimeout('hidimg()',3000)
}
else swapPic()
}
function hidimg()
{
dmwidth-=dmstepw
dmheight-=dmsteph
eval_r('divmask.style.clip="rect(0,'+dmwidth+','+dmheight+',0)"')
hdrun=setTimeout('hidimg()',timeout)
if(dmwidth<=spacewidth&&dmheight<=0)
{
divmask.style.visibility='hidden'
clearTimeout(hdrun)
swapPic()
}
}
</script>
第二步、调用定义好的javascript函数,在<body>里加上以下代码:
<body onload=swapPic()>
第三步、在页面中插入图片和链接:
<a href=javascript :void(null) onclick='javascript :pictarget();return false;'><img src="http://www.windstudio.net/banner/banner1.gif" width=468 height=60 border=0 name=pic style="visibility:hidden;filter:revealtrans(ration=2.0,transition=12)"></a>
好,到这里就大功告成了。另外,试试改变transition的数值,可以得到不同的转换效果哟~~
㈨ 图片切换代码
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户登陆</title>
<link rel="stylesheet" type="text/css" href="inc/link.css">
<script language="javascript">
function change(obj)
{
var img=new Image();
img.src="https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-.gif";
obj.src=img.src;
}
function reback(obj)
{
var img=new Image();
img.src="http://www..com/img/_logo.gif";
obj.src=img.src;
}
</script>
</head>
<body>
<img src="http://www..com/img/_logo.gif" width=200 height=50 onmouseover="change
(this)" onmouseout="reback(this)" />
</body>
</html>
㈩ 图片切换代码怎么做啊,带有数字的
试试这个图片切换
有12345数字一起切换
鼠标点一下数字会变换到另一张图片,不点就会自动换
里面有教程和源码