js浏览图片(ajax基础)

    技术2022-05-11  16

    <! DOCTYPE HTML PUBLIC  " -//W3C//DTD HTML 4.0 Transitional//EN " > < HTML >   < HEAD >    < TITLE >  New Document  </ TITLE >   </ HEAD >   < style type = " text/css " >   <!--  div#div1 {height:240px; filter:BlendTrans(duration=1);}   -->   </ style >   < SCRIPT LANGUAGE = " JavaScript " >   <!--      function  play()     {        var div1=document.getElementById("div1");        div1.filters[0].apply();        div1.innerHTML="<img src='2.jpg' alt='' height=300 width=300 />";        div1.filters[0].play();    }   // -->   </ SCRIPT >   < BODY >   < div id = " div1 " >   < img src = " 1.jpg "  alt = ""  height = " 300 "  width = " 300 " />   </ div >   < input type = " button "  value = " play "  onclick = " play() " />     </ BODY > </ HTML >

     

    实现简单相册

     

    <! DOCTYPE HTML PUBLIC  " -//W3C//DTD HTML 4.0 Transitional//EN " > < HTML >   < HEAD >    < TITLE >  New Document  </ TITLE >   </ HEAD >   < style type = " text/css " >   <!--  div#div1 {height:240px; filter:BlendTrans(duration=1);}   -->   </ style >    < SCRIPT LANGUAGE = " JavaScript " >   <!--      var  i = 1 ;     function  play()     {        if(i<6)        {            var div1=document.getElementById("div1");            div1.filters[0].apply();            i=i+1;            div1.innerHTML="<img src='"+i+".jpg' alt='' height=300 width=300 />";                        div1.filters[0].play();        }    }      function  play1()     {        if(i<=6&&i>1)        {            var div1=document.getElementById("div1");            div1.filters[0].apply();            i=i-1;            div1.innerHTML="<img src='"+i+".jpg' alt='' height=300 width=300 />";                        div1.filters[0].play();        }    }       // -->   </ SCRIPT >   < BODY >   < div id = " div1 " >   < img src = " 1.jpg "  alt = ""  height = " 300 "  width = " 300 " />   </ div >   < SCRIPT LANGUAGE = " JavaScript " >    </ SCRIPT >   < input type = " button "  value = " 下一张 "  id = " btn1 "  onclick = " play() " />      < input type = " button "  value = " 上一张 "  onclick = " play1() " />     </ BODY > </ HTML >

    最新回复(0)