简体   繁体   English

提供反应后如何在手机上隐藏反应文本

[英]How can I hide the reaction text on mobile after provide the reaction

I am using simple facebook like and comments system. 我正在使用简单的Facebook喜欢和评论系统。 You can see it here: http://creativeartbd.com/demo/facebook/ 您可以在这里看到它: http : //creativeartbd.com/demo/facebook/

Username : shibbirbd
password : 123456

Now, check this site on mobile or using your browser on mobile mode. 现在,在移动设备上或在移动模式下使用浏览器检查此站点。 After that click on post or comment reaction / like. 之后,点击发布或评论反应/喜欢。 It will show a list of reaction. 它将显示一个反应列表。

Now if you click on any reaction then you can see that reaction text is visible. 现在,如果您单击任何反应,那么您将看到反应文本可见。 I need to click again to hide that reaction text. 我需要再次单击以隐藏该反应文本。

is there any workaround to hide that reaction text once I have given the reaction? 我给出反应后,有什么解决方法可以隐藏该反应文本吗?

Inside the success callback of the send-reaction.php AJAX request, you need to add $("#"+x).hide(); send-reaction.php AJAX请求的success回调中,您需要添加$("#"+x).hide(); before you call $('#login-registraion-btn').modal('show'); 在调用$('#login-registraion-btn').modal('show'); .


A full example of the success callback : success callback完整示例:

$.ajax({
  type: "POST",
  url: "send-reaction.php",
  data: dataString,
  cache: false,
  beforeSend: function() {},
  success: function(html) {
    if (parseInt(html) == 1) {
      $("#like" + posts_id).html(htmlData).removeClass("reaction").removeClass("tooltipstered").addClass("unLike").attr("rel", "unlike");
      $("#" + x).hide();
      //refresh();
    } else if (html == 3) {
      $(".like_result").html(html);
      $("#login-registraion-btn").modal("show");

      // THESE TWO NEW LINES
      $("#" + x).hide();
      $(".tipsy").hide();
    }
  }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM