主頁 > 移動端開發 > Jquery隱藏同一父級中的“兄弟姐妹”元素

Jquery隱藏同一父級中的“兄弟姐妹”元素

2021-12-25 12:58:53 移動端開發

我是 jQuery 的新手,遇到了一個我不知道如何解決的問題。

我正在創建一個學習管理系統,供教師將家庭作業分配給他們的班級。在下面顯示的選單內,當用戶在“類設定”選項卡上時,他們應該能夠取消選中類名旁邊的框,這將:

  1. 隱藏分配/截止日期輸入,以及
  2. 通過使.unassigned類可見來替換這些輸入

如果用戶選中該框,則應該發生相反的情況,基本上就像切換一樣。

這是我不確定該怎么做的部分:我什至如何選擇相應<div class='assign'> <div class='due'> <div class='unassign'>的切換可見性?<section>我認為,所有這些都應該是將它們組合在一起父母的兄弟姐妹

現在我有

var status = $(this).find('section .unassigned');

只是除錯看看我是否可以選擇我想要選擇的元素,但我沒有成功。

任何幫助/解釋將不勝感激。

// This section handles UX feedback for class settings //
$('.class').on('change', 'input[type="checkbox"]', function() {
  var status = $(this).find('section .unassigned');
  status.css("background-color", "yellow");
  if ($(this).is(":checked")) { // When user checks box
    status.hide();
    alert('checked');
  }
  else { // When user unchecks box 
    status.show();
    alert('unchecked');
  }
});

// This section handles navigation //
function nav(arg) {
  var destination = arg.dataset.nav;
  var pages = document.querySelectorAll("[data-page]");
  var nav = document.querySelectorAll("[data-nav]");
  
  for (i = 0; i < nav.length; i  ) { // Remove the class 'active' if it exists
    nav[i].classList.remove('active')
  }
  arg.classList.add('active'); 
  
  for (i = 0; i < pages.length; i  ) { // Hide/show the correct pages
    if (pages[i].dataset.page != destination) {
      pages[i].style.display = "none";
    } else {
      if (destination == 'basic') {pages[i].style.display = "flex";}
      if (destination != 'basic') {pages[i].style.display = "block";}
    }
  }
}
.modal {display: block !Important}

.modal {
   display: none;
   position: fixed;
   z-index: 20;
   right: 0; top: 0;
   width: 100%; height: 100%;
   overflow: auto;
   background-color: rgba(0,0,0,0.4);
   -webkit-animation-name: fadeIn;
   -webkit-animation-duration: 0.4s;
   animation-name: fadeIn;
   animation-duration: 0.4s}

.assignment-window{
  display: grid;
  position: fixed;
  overflow: hidden;
  padding: 10px;
  padding-bottom: 16px;
  box-sizing: border-box;
  width: 100vw; height: 70vh;
  bottom: 0; left: 0;
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  background-color: white;
  grid-template-rows: auto 1fr;
  grid-template-columns: 0.9fr 2.5fr;
  grid-template-areas:
    "asstop asstop"
    "assnav asscontent"}


/* ----------[ASS TOP]---------- */
.asstop {
  grid-area: asstop;
  padding: 24px 20px;
  box-sizing: border-box;
  border-bottom: 2px solid #581F98;}

.asstop .title {
  display: flex;
  align-items: center;}

.asstop .title input {
  flex: 1 1;
  font-size: 24px;
  border-radius: 8px;
  margin-right: 20px;
  border: 1px solid lightgray}

.asstop select {
  outline: none;
  -webkit-appearance: none;
  padding: 12px 16px;
  font-size: 24px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid lightgray}

.asstop button {
  margin-top: -5px;}


/* ----------[ASS NAV]---------- */
.assnav {
  grid-area: assnav;
  padding-top: 20px;
  padding-right: 10%;
  border-right: 1px solid lightgray}

.assnav ul {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style-type: none}

.assnav li {
  display: block;
  text-decoration: none;
  color: #484848;
  font-size: 20px;
  padding: 14px 20px;
  margin-bottom: 10px;
  border-top-right-radius: 40px;
  border-bottom-right-radius: 40px;}
  .assnav li:hover {
    cursor: pointer;
    background-color: #F2F2F2}
  .assnav li.active {background-color: #EEEEEE}


/* ----------[ASS CONTENT]---------- */
.asscontent {
  grid-area: asscontent;
  display: flex;
  flex-direction: column;
  padding: 30px;
  box-sizing: border-box;
  overflow: scroll}

.asscontent input:not([type='checkbox']), .asscontent select {
  flex: 1;
  outline: none;
  -webkit-appearance: none;
  padding: 8px 16px;
  font-size: 18px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid lightgray}


/* ==== Basic Styling ==== */
.asscontent .basic {
  display: flex;
  height: 100%;
  flex-direction: column}

.asscontent .basic textarea {
  flex: 1;
  font-size: 18px;
  border-radius: 8px;
  box-sizing: border-box;}

.asscontent .basic .config {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;}
  .asscontent .basic input {text-align: center;}
  .asscontent .basic .points {width: 80px;}


/* ==== Attachment Styling ==== */
.asscontent .attachments {display: none}

.asscontent .attachments section {
  display: flex;
  justify-content: space-between;
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid lightgray}


/* ==== Class Styling ==== */
.asscontent .class {display: none}

.asscontent .class section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid lightgray}

.asscontent .class label {cursor: pointer;}

.asscontent .class .unassigned {
  flex: 1;
  text-align: center;
  font-style: italic;
  color: darkgray;}


/* ==== Delete Styling ==== */
.asscontent .delete {display: none;}

.asscontent .delete ul {margin-bottom: 30px;}

.asscontent .delete li {margin-bottom: 10px;}
<head>
  <link rel="stylesheet" href="https://classcolonies.com/resources/style.css">
  <link href="https://fonts.googleapis.com/css2?family=Raleway&display=swap" rel="stylesheet">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <nav></nav>
</head>

<div class="modal">
  <div class="assignment-window">
    <div class='asstop'>
      <div class='title'>
        <select>
          <option>??</option>
          <option>??</option>
          <option>??</option>
          <option>??</option>
          <option>??</option>
        </select>
        <input type='text' placeholder='Type assignment title..' value=''>
        <button class='button purple-btn'>Save Changes</button>
      </div>
    </div>
    <div class='assnav'>
      <ul>
        <li data-nav='basic' onclick='nav(this);' class='active'>Basic Setup</li>
        <li data-nav='attachments' onclick='nav(this);'>Attachments</li>
        <li data-nav='class' onclick='nav(this);'>Class Settings</li>
        <li data-nav='delete' onclick='nav(this);'>Delete Assignment</li>
      </ul>
    </div>
    <div class='asscontent'>
      <div class='basic' data-page='basic'>
        <textarea placeholder='Type assignment directions..'></textarea>
        <div class='config'>
          <section>
            <span>Subject: </span>
            <select>
              <option>Reading</option>
              <option>Social Studies</option>
            </select>
          </section>
          <section>
            <span>Points:</span>
            <input class='points' type='text'>
          </section>
          <section>
          <span>Submission: </span>
          <select>
            <option>Require students to scan.</option>
            <option>Allow scanning or turn in button.</option>
            <option>Grade only: students don't submit.</option>
            <option>Do not allow submissions.</option>
          </select>
        </section>
        </div>
      </div>
      <div class='attachments' data-page='attachments'>
        <section>
          <div class='displayName'>
            <select>
              <option>??</option>
              <option>??</option>
              <option>??</option>
            </select>
            <input name='attach[1][title]' placeholder='Title of website..' type='text'>
          </div>
          <div class='url'>
            <input name='attach[1][url]' placeholder='Insert website URL..' type='url'>
          </div>
          <div class='visible'>
            <span>Visible: <span>
            <select name='attach[1][visible]'>
              <option>- All Students -</option>
              <option>?? Reading/Social</option>
            </select>
          </div>
        </section>
      </div>
      <div class='class' data-page='class'>
        <section>
          <div class='name'>
            <label>
              <input type='checkbox' checked>
              ?? Reading/Social
            </label>
          </div>
          <div class='assign'>
            <span>Assign:</span>
            <input type='date'>
          </div>
          <div class='due'>
            <span>Due:</span>
            <input type='datetime-local'>
          </div>
          <div class='unassigned' hidden>
            <span>Not assigned to this class</span>
          </div>
        </section>
        <section>
          <div class='name'>
            <label>
              <input type='checkbox'>
              ?? Reading/Social
            </label>
          </div>
          <div class='assign' hidden>
            <span>Assign:</span>
            <input type='date'>
          </div>
          <div class='due' hidden>
            <span>Due:</span>
            <input type='datetime-local'>
          </div>
          <div class='unassigned'>
            <span>Not assigned to this class</span>
          </div>
        </section>
      </div>
      <div class='delete' data-page='delete'>
        <p>Deleting the assignment? The following will happen: </p>
        <ul>
          <li>All recorded submission and scores will be deleted.</li>
          <li>The assignment will be removed from student view.</li>
          <li>Student subject averages will adjust from the deleted scores.</li>
          <li>This action cannot be undone.</li>
        </ul>
        <button class='button grey-btn'>Cancel</button>
        <button class='button red-btn'>Permanently Delete</button>
      </div>
    </div>
  </div>
</div>

uj5u.com熱心網友回復:

您的選擇器正在搜索具有unassigneda類的元素,section但會.find()搜索$(this)您的checkbox.

var status = $(this).find('section .unassigned');

相反,您可以使用:

var unassigned = $(this).closest('section').find('.unassigned');

.closest()將匹配作為section元素的第一個父元素,然后.find()將匹配其具有unassigned該類的元素

// This section handles UX feedback for class settings //
$('.class').on('change', 'input[type="checkbox"]', function() {
  var unassigned = $(this).closest('section').find('.unassigned');
  var assign = $(this).closest('section').find('.assign');
  var due = $(this).closest('section').find('.due');
  unassigned.css("background-color", "yellow");
  if ($(this).is(":checked")) { // When user checks box
    unassigned.hide();
    assign.show();
    due.show();
  }
  else { // When user unchecks box 
    unassigned.show();
    assign.hide();
    due.hide();
  }
});

// This section handles navigation //
function nav(arg) {
  var destination = arg.dataset.nav;
  var pages = document.querySelectorAll("[data-page]");
  var nav = document.querySelectorAll("[data-nav]");
  
  for (i = 0; i < nav.length; i  ) { // Remove the class 'active' if it exists
    nav[i].classList.remove('active')
  }
  arg.classList.add('active'); 
  
  for (i = 0; i < pages.length; i  ) { // Hide/show the correct pages
    if (pages[i].dataset.page != destination) {
      pages[i].style.display = "none";
    } else {
      if (destination == 'basic') {pages[i].style.display = "flex";}
      if (destination != 'basic') {pages[i].style.display = "block";}
    }
  }
}
.modal {display: block !Important}

.modal {
   display: none;
   position: fixed;
   z-index: 20;
   right: 0; top: 0;
   width: 100%; height: 100%;
   overflow: auto;
   background-color: rgba(0,0,0,0.4);
   -webkit-animation-name: fadeIn;
   -webkit-animation-duration: 0.4s;
   animation-name: fadeIn;
   animation-duration: 0.4s}

.assignment-window{
  display: grid;
  position: fixed;
  overflow: hidden;
  padding: 10px;
  padding-bottom: 16px;
  box-sizing: border-box;
  width: 100vw; height: 70vh;
  bottom: 0; left: 0;
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  background-color: white;
  grid-template-rows: auto 1fr;
  grid-template-columns: 0.9fr 2.5fr;
  grid-template-areas:
    "asstop asstop"
    "assnav asscontent"}


/* ----------[ASS TOP]---------- */
.asstop {
  grid-area: asstop;
  padding: 24px 20px;
  box-sizing: border-box;
  border-bottom: 2px solid #581F98;}

.asstop .title {
  display: flex;
  align-items: center;}

.asstop .title input {
  flex: 1 1;
  font-size: 24px;
  border-radius: 8px;
  margin-right: 20px;
  border: 1px solid lightgray}

.asstop select {
  outline: none;
  -webkit-appearance: none;
  padding: 12px 16px;
  font-size: 24px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid lightgray}

.asstop button {
  margin-top: -5px;}


/* ----------[ASS NAV]---------- */
.assnav {
  grid-area: assnav;
  padding-top: 20px;
  padding-right: 10%;
  border-right: 1px solid lightgray}

.assnav ul {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style-type: none}

.assnav li {
  display: block;
  text-decoration: none;
  color: #484848;
  font-size: 20px;
  padding: 14px 20px;
  margin-bottom: 10px;
  border-top-right-radius: 40px;
  border-bottom-right-radius: 40px;}
  .assnav li:hover {
    cursor: pointer;
    background-color: #F2F2F2}
  .assnav li.active {background-color: #EEEEEE}


/* ----------[ASS CONTENT]---------- */
.asscontent {
  grid-area: asscontent;
  display: flex;
  flex-direction: column;
  padding: 30px;
  box-sizing: border-box;
  overflow: scroll}

.asscontent input:not([type='checkbox']), .asscontent select {
  flex: 1;
  outline: none;
  -webkit-appearance: none;
  padding: 8px 16px;
  font-size: 18px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid lightgray}


/* ==== Basic Styling ==== */
.asscontent .basic {
  display: flex;
  height: 100%;
  flex-direction: column}

.asscontent .basic textarea {
  flex: 1;
  font-size: 18px;
  border-radius: 8px;
  box-sizing: border-box;}

.asscontent .basic .config {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;}
  .asscontent .basic input {text-align: center;}
  .asscontent .basic .points {width: 80px;}


/* ==== Attachment Styling ==== */
.asscontent .attachments {display: none}

.asscontent .attachments section {
  display: flex;
  justify-content: space-between;
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid lightgray}


/* ==== Class Styling ==== */
.asscontent .class {display: none}

.asscontent .class section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid lightgray}

.asscontent .class label {cursor: pointer;}

.asscontent .class .unassigned {
  flex: 1;
  text-align: center;
  font-style: italic;
  color: darkgray;}


/* ==== Delete Styling ==== */
.asscontent .delete {display: none;}

.asscontent .delete ul {margin-bottom: 30px;}

.asscontent .delete li {margin-bottom: 10px;}
<head>
  <link rel="stylesheet" href="https://classcolonies.com/resources/style.css">
  <link href="https://fonts.googleapis.com/css2?family=Raleway&display=swap" rel="stylesheet">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <nav></nav>
</head>

<div class="modal">
  <div class="assignment-window">
    <div class='asstop'>
      <div class='title'>
        <select>
          <option>??</option>
          <option>??</option>
          <option>??</option>
          <option>??</option>
          <option>??</option>
        </select>
        <input type='text' placeholder='Type assignment title..' value=''>
        <button class='button purple-btn'>Save Changes</button>
      </div>
    </div>
    <div class='assnav'>
      <ul>
        <li data-nav='basic' onclick='nav(this);' class='active'>Basic Setup</li>
        <li data-nav='attachments' onclick='nav(this);'>Attachments</li>
        <li data-nav='class' onclick='nav(this);'>Class Settings</li>
        <li data-nav='delete' onclick='nav(this);'>Delete Assignment</li>
      </ul>
    </div>
    <div class='asscontent'>
      <div class='basic' data-page='basic'>
        <textarea placeholder='Type assignment directions..'></textarea>
        <div class='config'>
          <section>
            <span>Subject: </span>
            <select>
              <option>Reading</option>
              <option>Social Studies</option>
            </select>
          </section>
          <section>
            <span>Points:</span>
            <input class='points' type='text'>
          </section>
          <section>
          <span>Submission: </span>
          <select>
            <option>Require students to scan.</option>
            <option>Allow scanning or turn in button.</option>
            <option>Grade only: students don't submit.</option>
            <option>Do not allow submissions.</option>
          </select>
        </section>
        </div>
      </div>
      <div class='attachments' data-page='attachments'>
        <section>
          <div class='displayName'>
            <select>
              <option>??</option>
              <option>??</option>
              <option>??</option>
            </select>
            <input name='attach[1][title]' placeholder='Title of website..' type='text'>
          </div>
          <div class='url'>
            <input name='attach[1][url]' placeholder='Insert website URL..' type='url'>
          </div>
          <div class='visible'>
            <span>Visible: <span>
            <select name='attach[1][visible]'>
              <option>- All Students -</option>
              <option>?? Reading/Social</option>
            </select>
          </div>
        </section>
      </div>
      <div class='class' data-page='class'>
        <section>
          <div class='name'>
            <label>
              <input type='checkbox' checked>
              ?? Reading/Social
            </label>
          </div>
          <div class='assign'>
            <span>Assign:</span>
            <input type='date'>
          </div>
          <div class='due'>
            <span>Due:</span>
            <input type='datetime-local'>
          </div>
          <div class='unassigned' hidden>
            <span>Not assigned to this class</span>
          </div>
        </section>
        <section>
          <div class='name'>
            <label>
              <input type='checkbox'>
              ?? Reading/Social
            </label>
          </div>
          <div class='assign' hidden>
            <span>Assign:</span>
            <input type='date'>
          </div>
          <div class='due' hidden>
            <span>Due:</span>
            <input type='datetime-local'>
          </div>
          <div class='unassigned'>
            <span>Not assigned to this class</span>
          </div>
        </section>
      </div>
      <div class='delete' data-page='delete'>
        <p>Deleting the assignment? The following will happen: </p>
        <ul>
          <li>All recorded submission and scores will be deleted.</li>
          <li>The assignment will be removed from student view.</li>
          <li>Student subject averages will adjust from the deleted scores.</li>
          <li>This action cannot be undone.</li>
        </ul>
        <button class='button grey-btn'>Cancel</button>
        <button class='button red-btn'>Permanently Delete</button>
      </div>
    </div>
  </div>
</div>

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/392410.html

標籤:javascript 查询

上一篇:在頁面上查找文本并將其放入標簽中

下一篇:檔案大小的條件導致base64字串消失?

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 【從零開始擼一個App】Dagger2

    Dagger2是一個IOC框架,一般用于Android平臺,第一次接觸的朋友,一定會被搞得暈頭轉向。它延續了Java平臺Spring框架代碼碎片化,注解滿天飛的傳統。嘗試將各處代碼片段串聯起來,理清思緒,真不是件容易的事。更不用說還有各版本細微的差別。 與Spring不同的是,Spring是通過反射 ......

    uj5u.com 2020-09-10 06:57:59 more
  • Flutter Weekly Issue 66

    新聞 Flutter 季度調研結果分享 教程 Flutter+FaaS一體化任務編排的思考與設計 詳解Dart中如何通過注解生成代碼 GitHub 用對了嗎?Flutter 團隊分享如何管理大型開源專案 插件 flutter-bubble-tab-indicator A Flutter librar ......

    uj5u.com 2020-09-10 06:58:52 more
  • Proguard 常用規則

    介紹 Proguard 入口,如何查看輸出,如何使用 keep 設定入口以及使用實體,如何配置壓縮,混淆,校驗等規則。

    ......

    uj5u.com 2020-09-10 06:59:00 more
  • Android 開發技術周報 Issue#292

    新聞 Android即將獲得類AirDrop功能:可向附近設備快速分享檔案 谷歌為安卓檔案管理應用引入可安全隱藏資料的Safe Folder功能 Android TV新主界面將顯示電影、電視節目和應用推薦內容 泄露的Android檔案暗示了傳說中的谷歌Pixel 5a與折疊屏新機 谷歌發布Andro ......

    uj5u.com 2020-09-10 07:00:37 more
  • AutoFitTextureView Error inflating class

    報錯: Binary XML file line #0: Binary XML file line #0: Error inflating class xxx.AutoFitTextureView 解決: <com.example.testy2.AutoFitTextureView android: ......

    uj5u.com 2020-09-10 07:00:41 more
  • 根據Uri,Cursor沒有獲取到對應的屬性

    Android: 背景:呼叫攝像頭,拍攝視頻,指定保存的地址,但是回傳的Cursor檔案,只有名稱和大小的屬性,沒有其他諸如時長,連ID屬性都沒有 使用 cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DURATIO ......

    uj5u.com 2020-09-10 07:00:44 more
  • Android連載29-持久化技術

    一、持久化技術 我們平時所使用的APP產生的資料,在記憶體中都是瞬時的,會隨著斷電、關機等丟失資料,因此android系統采用了持久化技術,用于存盤這些“瞬時”資料 持久化技術包括:檔案存盤、SharedPreference存盤以及資料庫存盤,還有更復雜的SD卡記憶體儲。 二、檔案存盤 最基本存盤方式, ......

    uj5u.com 2020-09-10 07:00:47 more
  • Android Camera2Video整合到自己專案里

    背景: Android專案里呼叫攝像頭拍攝視頻,原本使用的 MediaStore.ACTION_VIDEO_CAPTURE, 后來因專案需要,改成了camera2 1.Camera2Video 官方demo有點問題,下載后,不能直接整合到專案 問題1.多次拍攝視頻崩潰 問題2.雙擊record按鈕, ......

    uj5u.com 2020-09-10 07:00:50 more
  • Android 開發技術周報 Issue#293

    新聞 谷歌為Android TV開發者提供多種新功能 Android 11將自動填表功能整合到鍵盤輸入建議中 谷歌宣布Android Auto即將支持更多的導航和數字停車應用 谷歌Pixel 5只有XL版本 搭載驍龍765G且將比Pixel 4更便宜 [圖]Wear OS將迎來重磅更新:應用啟動時間 ......

    uj5u.com 2020-09-10 07:01:38 more
  • 海豚星空掃碼投屏 Android 接收端 SDK 集成 六步驟

    掃碼投屏,開放網路,獨占設備,不需要額外下載軟體,微信掃碼,發現設備。支持標準DLNA協議,支持倍速播放。視頻,音頻,圖片投屏。好點意思。還支持自定義基于 DLNA 擴展的操作動作。好像要收費,沒體驗。 這里簡單記錄一下集成程序。 一 跟目錄的build.gradle添加私有mevan倉庫 mave ......

    uj5u.com 2020-09-10 07:01:43 more
最新发布
  • 歡迎頁輪播影片

    如圖,引導開始,球從上落下,同時淡入文字,然后文字開始輪播,最后一頁時停止,點擊進入首頁。 在來看看效果圖。 重力球先不講,主要歡迎輪播簡單實作 首先新建一個類 TextTranslationXGuideView,用于影片展示 文本是類似的,最后會有個圖片箭頭影片,布局很簡單,就是一個 TextVi ......

    uj5u.com 2023-04-20 08:40:31 more
  • 【FAQ】關于華為推送服務因營銷訊息頻次管控導致服務通訊類訊息

    一. 問題描述 使用華為推送服務下發IM訊息時,下發訊息請求成功且code碼為80000000,但是手機總是收不到訊息; 在華為推送自助分析(Beta)平臺查看發現,訊息發送觸發了頻控。 二. 問題原因及背景 2023年1月05日起,華為推送服務對咨詢營銷類訊息做了單個設備每日推送數量上限管理,具體 ......

    uj5u.com 2023-04-20 08:40:11 more
  • 歡迎頁輪播影片

    如圖,引導開始,球從上落下,同時淡入文字,然后文字開始輪播,最后一頁時停止,點擊進入首頁。 在來看看效果圖。 重力球先不講,主要歡迎輪播簡單實作 首先新建一個類 TextTranslationXGuideView,用于影片展示 文本是類似的,最后會有個圖片箭頭影片,布局很簡單,就是一個 TextVi ......

    uj5u.com 2023-04-20 08:39:36 more
  • 【FAQ】關于華為推送服務因營銷訊息頻次管控導致服務通訊類訊息

    一. 問題描述 使用華為推送服務下發IM訊息時,下發訊息請求成功且code碼為80000000,但是手機總是收不到訊息; 在華為推送自助分析(Beta)平臺查看發現,訊息發送觸發了頻控。 二. 問題原因及背景 2023年1月05日起,華為推送服務對咨詢營銷類訊息做了單個設備每日推送數量上限管理,具體 ......

    uj5u.com 2023-04-20 08:39:13 more
  • iOS從UI記憶體地址到讀取成員變數(oc/swift)

    開發除錯時,我們發現bug時常首先是從UI顯示發現例外,下一步才會去定位UI相關連的資料的。XCode有給我們提供一系列debug工具,但是很多人可能還沒有形成一套穩定的除錯流程,因此本文嘗試解決這個問題,順便提出一個暴論:UI顯示例外問題只需要兩個步驟就能完成定位作業的80%: 定位例外 UI 組 ......

    uj5u.com 2023-04-19 09:16:23 more
  • FIDE重磅更新!性能飛躍!體驗有禮!

    FIDE 開發者工具重構升級啦!實作500%性能提升,誠邀體驗! 一直以來不少開發者朋友在社區反饋,在使用 FIDE 工具的程序中,時常會遇到諸如加載不及時、代碼預覽/渲染性能不如意的情況,十分影響開發體驗。 作為技術團隊,我們深知一件趁手的開發工具對開發者的重要性,因此,在2023年開年,FinC ......

    uj5u.com 2023-04-19 09:16:15 more
  • 游戲內嵌社區服務開放,助力開發者提升玩家互動與留存

    華為 HMS Core 游戲內嵌社區服務提供快速訪問華為游戲中心論壇能力,支持玩家直接在游戲內瀏覽帖子和交流互動,助力開發者擴展內容生產和觸達的場景。 一、為什么要游戲內嵌社區? 二、游戲內嵌社區的典型使用場景 1、游戲內打開論壇 您可以在游戲內繪制論壇入口,為玩家提供沉浸式發帖、瀏覽、點贊、回帖、 ......

    uj5u.com 2023-04-19 09:15:46 more
  • iOS從UI記憶體地址到讀取成員變數(oc/swift)

    開發除錯時,我們發現bug時常首先是從UI顯示發現例外,下一步才會去定位UI相關連的資料的。XCode有給我們提供一系列debug工具,但是很多人可能還沒有形成一套穩定的除錯流程,因此本文嘗試解決這個問題,順便提出一個暴論:UI顯示例外問題只需要兩個步驟就能完成定位作業的80%: 定位例外 UI 組 ......

    uj5u.com 2023-04-19 09:14:53 more
  • FIDE重磅更新!性能飛躍!體驗有禮!

    FIDE 開發者工具重構升級啦!實作500%性能提升,誠邀體驗! 一直以來不少開發者朋友在社區反饋,在使用 FIDE 工具的程序中,時常會遇到諸如加載不及時、代碼預覽/渲染性能不如意的情況,十分影響開發體驗。 作為技術團隊,我們深知一件趁手的開發工具對開發者的重要性,因此,在2023年開年,FinC ......

    uj5u.com 2023-04-19 09:14:08 more
  • 游戲內嵌社區服務開放,助力開發者提升玩家互動與留存

    華為 HMS Core 游戲內嵌社區服務提供快速訪問華為游戲中心論壇能力,支持玩家直接在游戲內瀏覽帖子和交流互動,助力開發者擴展內容生產和觸達的場景。 一、為什么要游戲內嵌社區? 二、游戲內嵌社區的典型使用場景 1、游戲內打開論壇 您可以在游戲內繪制論壇入口,為玩家提供沉浸式發帖、瀏覽、點贊、回帖、 ......

    uj5u.com 2023-04-19 09:08:34 more