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

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

目標只點擊錨而不是兄弟

目標只點擊錨而不是兄弟

守候你守候我 2021-12-02 16:33:14
我需要在兩個不同的集合上觸發我的函數。這該怎么做?我有這樣的東西,但第二個函數首先覆蓋,第一個不起作用。這該怎么做?'使用嚴格'; const functions = require('firebase-functions');const admin = require('firebase-admin');admin.initializeApp(functions.config().firebase); const 數據庫 = admin.database();exports.apptTrigger = functions.firestore    .document('notification/{anydocument}' )    .onCreate((snap, context) => {    const title = snap.data().title;    const messageis = snap.data().content;    const postId = snap.data().idPost;    const payLoad = {        notification:{            title: title,            body: messageis,            sound: "default"        }    };        return admin.messaging().sendToTopic("notification", payLoad);});exports.apptTrigger = functions.firestore    .document('notificationP/{anydocument}')    .onCreate((snap, context) => {    const title = snap.data().title;    const messageis = snap.data().content;    const postId = snap.data().idPost;    const payLoad = {        notification:{            title: title,            body: messageis,            sound: "default"        }    };        return admin.messaging().sendToTopic("notification", payLoad);});```
查看完整描述

2 回答

?
嗶嗶one

TA貢獻1854條經驗 獲得超8個贊

$('.toggle-text').text('Less Info')

上面的行將選擇您的所有.toggle-text元素。如果.toggle-text是您的子元素,.container-outer您可以執行以下操作:


$('.container-outer.active').find('.toggle-text').text('Less Info');

$('.container-outer:not(.active)').find('.toggle-text').text('More Info');

它應該工作。


查看完整回答
反對 回復 2021-12-02
?
撒科打諢

TA貢獻1934條經驗 獲得超2個贊

這是你想要的嗎 ?


$('.more-info').on('click', function() {

  $(".more-info").removeClass("active").html("More Info");

  $(this).addClass("active").html("Less Info");

});

a{

display:block;

padding:10px;

background:#f5f5f5;

margin:10px;

}

.active{

  color:red;

{

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>


<a class="more-info">More Info</a>

<a class="more-info">More Info</a>

<a class="more-info">More Info</a>

<a class="more-info">More Info</a>


查看完整回答
反對 回復 2021-12-02
  • 2 回答
  • 0 關注
  • 180 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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