㈠ 圖片切換代碼(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數字一起切換
滑鼠點一下數字會變換到另一張圖片,不點就會自動換
裡面有教程和源碼