建站资源下载详情
为您免费提供多种建站资源下载,包括网站模板下载、前端插件下载和字体下载!您只需注册为会员即可任意下载!

full page 全屏页面滑块JQuery插件

来源:易助科技网浏览量:19收藏

简介


一个用JavaScript(jQuery)和CSS动画实现的垂直全屏演示应用程序(也称为全屏页面滑块)。

(下载的附件中附有DEMO)


更多 HTML 演示插件:👉  [ 详情 ]


JQuery全屏页面滑块插件



使用


1.  引入文件


<link href="https://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">

<script
 src="https://kit.fontawesome.com/e12504a0e7.js"
 crossorigin="anonymous"
></script>

<link rel="stylesheet" href="style.css" />


2.  HTML


将演示文稿添加到网页中:


<!--Page 1-->
<section id="page_1" class="page">
  <h1>Welcome To My Presentation</h1>
  <p>
    Presentation 1
  </p>
  <a href="#page_2" class="btn"
    >Next Page
  </a>
</section>
<!--Page 2-->
<section id="page_2" class="page">
  <h1>Welcome To Page-2</h1>
  <p>
    Presentation 2
  </p>
  <div>
    <a href="#page_1" class="btn btn_dark"
      >Prev Page>
    </a>
    <a href="#page_3" class="btn"
      >Next Page
    </a>
  </div>
</section>
<!--Page 3-->
<section id="page_3" class="page">
  <h1>Welcome To Page-3</h1>
  <p>
    Presentation 3
  </p>
  <div>
    <a href="#page_2" class="btn btn_dark"
      >Prev Page <i class="fas fa-arrow-circle-up"> </i>
    </a>
  </div>
</section>
<!-- More Presentations Here -->


演示文稿布局的主要CSS样式:


<style>
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  line-height: 1.5;
  color: #fff;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 4rem;
}

.page h1 {
  font-size: 4rem;
  line-height: 1.2;
  margin: 1rem;
}

.page p {
  font-size: 1.3rem;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: #f4f4f4;
  color: #333;
  border-radius: 5px;
  border: none;
  margin-top: 1rem;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all ease-in 0.3s;
}

.btn:hover,
.btn_dark {
  background: #333;
  color: #fff;
}

.btn_dark:hover {
  background: #f4f4f4;
  color: #333;
}
</style>


自定义演示文稿的背景色:


<style>
#page_1 {
  background: '#222';
}

#page_2 {
  background: '#333';
}

#page_3 {
  background: '#444';
}
</style>


使用CSS3动画制作内容动画:


<style>
#page_1 h1 {
  transform: translateY(-1000px);
  animation: heading 1s forwards ease-in;
}

@keyframes heading {
  to {
    transform: translateY(0);
  }
}

#page_1 p {
  transform: translateX(-2000px);
  animation: text 2.7s forwards ease-in;
}

@keyframes text {
  to {
    transform: translateX(0);
  }
}
</style>


3.  调用


$(".btn").on("click", function(event) {
  if (this.hash !== "") {
    event.preventDefault();
    const hash = this.hash;
    $("html, body").animate(
      {
        scrollTop: $(hash).offset().top
      },
      800
    );
  }
});



相关链接


易助科技网效果演示地址:  http://demo.easyzone.net.cn/plugin/fullpage/index.html