css3 html js制作背景自动幻灯片cid1124-网页前端设计

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>jQuery mkinfinite Plugin Demo</title>
  5. <style>
  6. html, body {
  7. height: 100%;
  8. margin: 0px;
  9. padding: 0px;
  10. }
  11. body {
  12. min-width: 999px;
  13. }
  14. header {
  15. height: 100%;
  16. position: relative;
  17. }
  18. header div.content {
  19. width: 100%;
  20. position: absolute;
  21. left: 0px;
  22. right: 0px;
  23. top: 50%;
  24. max-width: none;
  25. height: 190px;
  26. margin-top: -95px;
  27. background: rgba(255,255,255,0.8);
  28. text-align: center;
  29. font-size: 80px;
  30. font-family: impact;
  31. }
  32. .color-1 {
  33. color: #00bfff;
  34. line-height: 180px;
  35. }
  36. .color-2 {
  37. color: #ff007f;
  38. margin-left: 10px;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <header>
  44. <div class="content">
  45. <span class="color-1">IMAGE</span><span class="color-2">SLIDESHOW</span> </div>
  46. </header>
  47. <script src="https://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
  48. <script type="text/javascript" src="../src/jquery.mkinfinite.js"></script>
  49. <script type="text/javascript">
  50. $(document).ready(function(){
  51. $('header').mkinfinite({
  52. maxZoom: 1.4,
  53. animationTime: 4000,
  54. imagesRatio: (960 / 720),
  55. isFixedBG: true,
  56. zoomIn: true,
  57. imagesList: new Array(
  58. 'https://images.pexels.com/photos/1368389/pexels-photo-1368389.jpeg?cs=srgb&dl=dawn-dusk-fog-1368389.jpg&fm=jpg',
  59. 'https://images.pexels.com/photos/1677358/pexels-photo-1677358.jpeg?cs=srgb&dl=aerial-shot-bird-s-eye-view-buildings-1677358.jpg&fm=jpg',
  60. 'https://images.pexels.com/photos/1141853/pexels-photo-1141853.jpeg?cs=srgb&dl=architecture-bridge-fog-1141853.jpg&fm=jpg',
  61. 'https://images.pexels.com/photos/1115487/pexels-photo-1115487.jpeg?cs=srgb&dl=dawn-daylight-hill-1115487.jpg&fm=jpg'
  62. )
  63. });
  64. });
  65. </script>
  66. index-2.html
  67. </body>
  68. </html>
<!doctype html>
<html>
<head>
 
    <title>jQuery mkinfinite Plugin Demo</title>
    <style>
 

html, body {
  height: 100%;
  margin: 0px;
  padding: 0px;
}

body {
   
  min-width: 999px;
}

header {
  height: 100%;
  position: relative;
}

header div.content {
  width: 100%;
  position: absolute;
  left: 0px;
  right: 0px;
  top: 50%;
  max-width: none;
  height: 190px;
  margin-top: -95px;
  background: rgba(255,255,255,0.8);
  text-align: center;
    font-size: 80px;
    font-family: impact;
    
}

 

.color-1 {
  color: #00bfff;
    line-height: 180px;
}

.color-2 {
  color: #ff007f;
    margin-left: 10px;
}
    
    </style>
</head>
  <body>
    <header>
      <div class="content">
          <span class="color-1">IMAGE</span><span class="color-2">SLIDESHOW</span> </div>
       
    </header>
    
    <script src="https://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
    
    <script type="text/javascript" src="../src/jquery.mkinfinite.js"></script>
    
    <script type="text/javascript">
      $(document).ready(function(){
        $('header').mkinfinite({
          maxZoom:       1.4,
          animationTime: 4000,
          imagesRatio:   (960 / 720),
          isFixedBG:     true,
          zoomIn:        true,
          imagesList:    new Array(
            'https://images.pexels.com/photos/1368389/pexels-photo-1368389.jpeg?cs=srgb&dl=dawn-dusk-fog-1368389.jpg&fm=jpg',
            'https://images.pexels.com/photos/1677358/pexels-photo-1677358.jpeg?cs=srgb&dl=aerial-shot-bird-s-eye-view-buildings-1677358.jpg&fm=jpg',
                        
            'https://images.pexels.com/photos/1141853/pexels-photo-1141853.jpeg?cs=srgb&dl=architecture-bridge-fog-1141853.jpg&fm=jpg',
            'https://images.pexels.com/photos/1115487/pexels-photo-1115487.jpeg?cs=srgb&dl=dawn-daylight-hill-1115487.jpg&fm=jpg'
          )
        });
      });
    </script>
index-2.html
  </body>
</html>

在线演示


让链接同时具备两种打开方式
获取源码: Simple-jQuery-Background-Slideshow-with-Zoom-Animations-mkinfinite
下载数:130人次, 文件大小: 2.9 KB, 上传日期: 2020年-11 月-29日

公众号回复:gcode  获取解压密码

qrcode_for_gh_6ea2c28a1709_258 (1)

2,938 人查阅

类似文章