亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

jQuery 輪播幻燈片動畫

jQuery 輪播幻燈片動畫

繁星coding 2023-09-04 16:57:02
我正在研究 jQuery 輪播。這是我的代碼:  // CAROUSEL  $('#left-arrow').click(previousSlide);  $('#right-arrow').click(nextSlide);function nextSlide() {    var $currentSlide = $('#carousel .slide-image:first');    var width = $currentSlide.width();    var $lastSlide = $('#carousel .slide-image:last')    $currentSlide.animate({ 'margin-left': -width }, 1000, function() {        $currentSlide.remove().css({ 'margin-left': '0px' });        $lastSlide.after($currentSlide);    });  }  function previousSlide() {    var $currentSlide = $('#carousel .slide-image:first');    var width = $currentSlide.width();    var $last = $('#carousel .slide-image:last');    $last.remove().css({ 'margin-left': -width });    $currentSlide.before($last);    $last.animate({ 'margin-left': '0px' }, 1000);  }/* CAROUSEL */#slide1 {  background-color: red;}#slide2 {  background-color: blue;}#slide3 {  background-color: magenta;}#carousel {  overflow: hidden;  white-space: nowrap;  position: relative;  width: 100vw;  height: 75vh;}.slide-image {  width: 100vw;  height: 75vh;  background-position: center;  background-size: cover;  display: inline-block;}.arrow {  width: 2%;  position: absolute;  top: 50%;  transform: translateY(-50%);  cursor: pointer;}#right-arrow {  right: 30px;}#left-arrow {  left: 30px;}
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關注
  • 141 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號