美文网首页
使用经验

使用经验

作者: 吧啦啦小汤圆 | 来源:发表于2016-11-19 17:59 被阅读3次

comments_data[k].com_content是一个变量;
comment = '<li >' +comments_data[k].com_content + '</li>';
$("p").after(comment );

触发器控制模拟开关:

var comment_flip =  
 '<a class="flip">' +  
      '  <i>收起</i>' + 
      '  <i style="display:none;">展开</i>' +  
 '</a>';

#将上面定义的标签显示在页面上。
$('[data-pid=' + data_pid + ']').find('.post-tools')
                                .after(comment_flip);

#为上面的展开收起元素添加点击事件
$('.flip').click(function () {   

#获取页面需要展开和收起切换的部分
var current_panel = $(this).closest('div').next(); 

#使用slideToggle()方法实现页面上一部分的`显示`与`隐藏`的 切换  
current_panel.slideToggle("normal");   

# 当前标签a的孩子i 模拟开关,一开一关,即‘收起’ 和 ‘展开’ 像开关一样切换
$(this).children('i').toggle();   

相关文章

  • 使用经验

    comments_data[k].com_content是一个变量;comment = ' ' +comment...

  • 使用经验

    1、采用DIV行列部局,行里面直接布局的UI是列,每一行最多分为12列,列里面可嵌套行,通过样式(row,col-...

  • jupyter使用经验

    从指定目录打开jupyter notebook win7下由anaconda安装的jupyter notebook...

  • ArchLinux 使用经验

    1 切换国内源 //选择中国源并更新 sudo pacman -Syyu //更新系统 2 添加archlinu...

  • angular使用经验

    JSONP使用方法 自建服务 有的时候我们需要建立自己的服务,而不是每次都在controller里面进行$http...

  • Mac 使用经验

    开启 Anywheresudo spctl --master-disable 在Finder 中央显示路径defa...

  • ubuntu使用经验

    1、与windows 8小时时差 sudo timedatectl set-local-rtc 1 2、安装文泉驿...

  • Xshell使用经验

    前言 记录一下。 准备 Xshell 步骤 新建,输入如下图:点击确定。 点击接受并保存,如下图: 输入用户名,一...

  • git使用经验

    https://gitbook.tw/[https://gitbook.tw/] https://www.ruan...

  • Axios使用经验

    跨域调用接口注意事项 在跨域调用并且需要传递cookie的时候,我们会增加withCredentials:true...

网友评论

      本文标题:使用经验

      本文链接:https://www.haomeiwen.com/subject/snlepttx.html