第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

單擊jquery / javascript后顯示選項卡類

單擊jquery / javascript后顯示選項卡類

不負相思意 2021-04-30 20:17:43
我是JS的初學(xué)者,我在標(biāo)簽菜單的html中添加了標(biāo)簽滑塊,我將其分為3類:全部,創(chuàng)意和品牌,單擊li之一后如何顯示div?我已將類添加到li并為圖像創(chuàng)建了2個div,但是下一步該怎么做?這是一些代碼。$(document).ready(function(){$("ul li").click(function(e) {  // make sure we cannot click the slider  if ($(this).hasClass('slider')) {    return;  }  /* Add the slider movement */  // what tab was pressed  var whatTab = $(this).index();  // Work out how far the slider needs to go  var howFar = 160 * whatTab;  $(".slider").css({    left: howFar + "px"  });  /* Add the ripple */  // Remove olds ones  $(".ripple").remove();  // Setup  var posX = $(this).offset().left,      posY = $(this).offset().top,      buttonWidth = $(this).width(),      buttonHeight = $(this).height();  // Add the element  $(this).prepend("<span class='ripple'></span>");  // Make it round!  if (buttonWidth >= buttonHeight) {    buttonHeight = buttonWidth;  } else {    buttonWidth = buttonHeight;  }  // Get the center of the element  var x = e.pageX - posX - buttonWidth / 2;  var y = e.pageY - posY - buttonHeight / 2;  // Add the ripples CSS and start the animation  $(".ripple").css({    width: buttonWidth,    height: buttonHeight,    top: y + 'px',    left: x + 'px'  }).addClass("rippleEffect");});});<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><div class="container3">        <h1>OUR PORTFOLIO</h1>        <p>Lorem ipsum lorem exciting          ipsum lore portfolio</p>          <div class="portfolio">            <ul>      <li class="all">All</li>      <li class="creative">Creative</li>      <li class ="branding">Branding</li>      <li class="slider"></li>    </ul>    <div class="photo" id="photo"style="display:none">      <img src="img/icon2.png"/>    </div>    <div class="photo2" id="photo2"style="display:none">      <img src="img/icon3.png"/>    </div>    </div>
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 212 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號