隨筆 - 11  文章 - 2  trackbacks - 0
          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          常用鏈接

          留言簿(1)

          隨筆檔案

          相冊

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://http://www.w3.org/TR/html4/strict.dtd">
          <html>
          <head>
              <title>圖片滾動</title>
              <style type="text/css">
          <!--
              body{
                  background-image:url('../../
                  background-repeat:no-repeat;
                  padding-top:80px;
              }
              #dhtmlgoodies_slideshow{
                  width:600px;    /* Total width of slideshow */
              }
              #previewPane{
                  border:1px solid #CCCCCC;
                  margin-bottom:10px;   
                  text-align:center;
                  vertical-align:middle;
                  padding-top:10px;
                                          background-color:#CCC;
                  position:relative;
                  /* CSS HACK */
                  height: 432px;    /* IE 5.x */
                  height/* */:/**/420px;    /* Other browsers */
                  height: /**/420px;
              }
              #previewPane img{
                  line-height:400px;
              }
              #previewPane #largeImageCaption{    /* CSS styling of image caption below large image */
                  font-style:italic;
                  text-align:center;
                  font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif;    /* Font to use */
                  font-size:0.9em;
              }
              #galleryContainer{
                  height:102px;    /* Height of the
          http://www.sanda.com.cn/new/image + 2 */
                  border:1px solid #CCCCCC;
                  position:relative;
                  overflow:hidden;
                  padding:1px;
                  /* CSS HACK */
                  height: 104px;    /* IE 5.x - Added 2 pixels for border left and right */
                  height/* */:/**/102px;    /* Other browsers */
                  height: /**/102px;
              }
              #arrow_left{
                  position:absolute;
                  left:0px;
                  z-index:10;
                  background-color: #FFF;
                  padding:1px;
              }
              #arrow_right{
                  position:absolute;
                  right:0px;
                  z-index:10;
                  background-color: #FFF;
                  padding:1px;       
              }
              #theImages{
                  position:absolute;
                  height:100px;
                  left:40px;
                  width:100000px;
              }
              #theImages #slideEnd{
                  float:left;
              }
              #theImages img{
                  float:left;
                  padding:1px;
                  filter: alpha(opacity=50);
                  opacity: 0.5;
                  cursor:pointer;
                  border:0px;
              }
              #waitMessage{
                  display:none;
                  position:absolute;
                  left:200px;
                  top:150px;
                  background-color:#FFF;
                  border:3px double #000;
                  padding:4px;
                  color:#555;
                  font-size:0.9em;
                  font-family:arial;   
              }
              #theImages .imageCaption{
                  display:none;
              }
          -->
          </style>
              <script type="text/javascript" >
             var displayWaitMessage=true;    // Display a please wait message while http://www.sanda.com.cn/new/image are loading?
              var activeImage = false;
              var imageGalleryLeftPos = false;
              var imageGalleryWidth = false;
              var imageGalleryObj = false;
              var maxGalleryXPos = false;
              var slideSpeed = 0;
              var imageGalleryCaptions = new Array();
              function startSlide(e)
              {
                  if(document.all)e = event;
                  var id = this.id;
                  this.getElementsByTagName('IMG')[0].src = ' + this.id + '_over.gif';   
                  if(this.id=='arrow_right'){
                      slideSpeedMultiply = Math.floor((e.clientX - this.offsetLeft) / 5);
                      slideSpeed = -1*slideSpeedMultiply;
                      slideSpeed = Math.max(-10,slideSpeed);
                  }else{           
                      slideSpeedMultiply = 10 - Math.floor((e.clientX - this.offsetLeft) / 5);
                      slideSpeed = 1*slideSpeedMultiply;
                      slideSpeed = Math.min(10,slideSpeed);
                      if(slideSpeed<0)slideSpeed=10;
                  }
              }
              function releaseSlide()
              {
                  var id = this.id;
                  this.getElementsByTagName('IMG')[0].src = '
          + this.id + '.gif';
                  slideSpeed=0;
              }
              function gallerySlide()
              {
                  if(slideSpeed!=0){
                      var leftPos = imageGalleryObj.offsetLeft;
                      leftPos = leftPos/1 + slideSpeed;
                      if(leftPos>maxGalleryXPos){
                          leftPos = maxGalleryXPos;
                          slideSpeed = 0;
                      }
                      if(leftPos<minGalleryXPos){
                          leftPos = minGalleryXPos;
                          slideSpeed=0;
                      }
                      imageGalleryObj.style.left = leftPos + 'px';
                  }
                  setTimeout('gallerySlide()',20);
              }
              function showImage()
              {
                  if(activeImage){
                      activeImage.style.filter = 'alpha(opacity=50)';   
                      activeImage.style.opacity = 0.5;
                  }   
                  this.style.filter = 'alpha(opacity=100)';
                  this.style.opacity = 1;   
                  activeImage = this;   
              }
              function initSlideShow()
              {
                  document.getElementById('arrow_left').onmousemove = startSlide;
                  document.getElementById('arrow_left').onmouseout = releaseSlide;
                  document.getElementById('arrow_right').onmousemove = startSlide;
                  document.getElementById('arrow_right').onmouseout = releaseSlide;
                  imageGalleryObj = document.getElementById('theImages');
                  imageGalleryLeftPos = imageGalleryObj.offsetLeft;
                  imageGalleryWidth = document.getElementById('galleryContainer').offsetWidth - 80;
                  maxGalleryXPos = imageGalleryObj.offsetLeft;
                  minGalleryXPos = imageGalleryWidth - document.getElementById('slideEnd').offsetLeft;
                  var slideshowImages = imageGalleryObj.getElementsByTagName('IMG');
                  for(var no=0;no<slideshowImages.length;no++){
                      slideshowImages[no].onmouseover = showImage;
                  }
                  var divs = imageGalleryObj.getElementsByTagName('DIV');
                  for(var no=0;no<divs.length;no++){
                      if(divs[no].className=='imageCaption')imageGalleryCaptions[imageGalleryCaptions.length] = divs[no].innerHTML;
                  }
                  gallerySlide();
              }
              function showPreview(imagePath,imageIndex){
                  var subImages = document.getElementById('previewPane').getElementsByTagName('IMG');
                  if(subImages.length==0){
                      var img = document.createElement('IMG');
                      document.getElementById('previewPane').appendChild(img);
                  }else img = subImages[0];
                  if(displayWaitMessage){
                      document.getElementById('waitMessage').style.display='inline';
                  }
                  document.getElementById('largeImageCaption').style.display='none';
                  img.onload = function() { hideWaitMessageAndShowCaption(imageIndex-1); };
                  img.src = imagePath;
              }
              function hideWaitMessageAndShowCaption(imageIndex)
              {
                  document.getElementById('waitMessage').style.display='none';   
                  document.getElementById('largeImageCaption').innerHTML = imageGalleryCaptions[imageIndex];
                  document.getElementById('largeImageCaption').style.display='block';
              }
              window.onload = initSlideShow;
              </script>
          </head>
          <body>
          <div id="dhtmlgoodies_slideshow">
              <div id="galleryContainer">
                  <div id="arrow_left"><img src="
          ></div>
                  <div id="arrow_right"><img src="
          ></div>
                  <div id="theImages">
                          <!-- Thumbnails -->
                          <a href="#"><img src="
          ></a>       
                          <a href="#"><img src="
          ></a>       
                          <a href="#"><img src="
          ></a>       
                          <a href="#"><img src="
          ></a>       
                          <a href="#"><img src="
          ></a>       
                          <a href="#"><img src="
          ></a>       
                          <a href="#"><img src="
          ></a>       
                          <a href="#" ><img src="
          ></a>   
                          <!-- End thumbnails -->
                          <!-- Image captions -->   
                          <div class="imageCaption">圖片1</div>
                          <div class="imageCaption">圖片 2</div>
                          <div class="imageCaption">圖片 3</div>
                          <div class="imageCaption">圖片4</div>
                          <div class="imageCaption">圖片 5</div>
                          <div class="imageCaption">圖片 6</div>
                          <div class="imageCaption">圖片 7</div>
                          <div class="imageCaption">圖片 8</div>
                          <!-- End image captions -->
                          <div id="slideEnd"></div>
                  </div>
              </div>
          </div>
          </body>
          </html>

          posted @ 2007-07-14 13:24 jacksontoto 閱讀(2013) | 評論 (0)編輯 收藏
          僅列出標題
          共2頁: 上一頁 1 2 
          主站蜘蛛池模板: 桃园县| 甘孜县| 齐齐哈尔市| 罗定市| 开江县| 深州市| 东海县| 通州区| 根河市| 宾川县| 灵台县| 蕲春县| 浮梁县| 唐山市| 息烽县| 丽水市| 习水县| 安远县| 陇川县| 霍邱县| 长寿区| 武乡县| 威远县| 巍山| 巨鹿县| 正镶白旗| 临武县| 仁化县| 贵德县| 绥阳县| 剑川县| 岳池县| 彭山县| 县级市| 长宁县| 宜春市| 武清区| 桂阳县| 江都市| 武威市| 神农架林区|