美文网首页
2019-07-31一些方法

2019-07-31一些方法

作者: 那年那夏你很美 | 来源:发表于2019-07-31 16:16 被阅读0次

常用方法

//截取(单)参数方法

function getUrlParamsData(name) {

var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");

var r = window.location.search.substr(1).match(reg);

if (r != null) return unescape(r[2]);

return null;

}

//获取当前时间

function getNowFormatDate() {

    var date = new Date();

    var seperator1 = "-";

    var seperator2 = ":";

    var month = date.getMonth() + 1;

    var strDate = date.getDate();

    if (month >= 1 && month <= 9) {

        month = "0" + month;

    }

    if (strDate >= 0 && strDate <= 9) {

        strDate = "0" + strDate;

    }

    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate

            + " " + date.getHours() + seperator2 + date.getMinutes()

            + seperator2 + date.getSeconds();

    return currentdate;

}

//生成随机数32位

function newGuid() {

    var guid = "";

    for (var i = 1; i <= 32; i++) {

        var n = Math.floor(Math.random() * 16.0).toString(16);

        guid += n;

        if ((i == 8) || (i == 12) || (i == 16) || (i == 20))

            guid += "-";

    }

    return guid;

}

//动态获取ifream高度

//改变父级iframe高度

var parentIframe = parent.$('.treeseven');

setTimeout(function(){

parentIframe.css("height",document.body.scrollHeight);

parent.count();}

,100);

//页签切换

var m_tabSwitch = function() {

var m_tabs = $('.tab-switch li');

m_tabs.click(function(e) {

// 清除默认事件

e.preventDefault();

var index = $(this).index();

//避免因为两个页签产生干扰

var m_detail = $(this).parents('.tab:first').find('.switch-detial:first > div');

//避免因为两个页签产生干扰

$(this).parents('.tab-switch:first').find('li').removeClass('active');

$(this).addClass('active');

m_detail.removeClass('active');

m_detail.eq(index).addClass('active');

})

}

相关文章

  • 2019—07—31

    2019-07-31 纤秋 字数 454 · 阅读 0 2019-07-31 09:56 儿时每次上街玩,看到书店...

  • 2019-07-31一些方法

    常用方法 //截取(单)参数方法 functiongetUrlParamsData(name){ varreg=n...

  • Lan的ScalersTalk第四轮新概念朗读持续力训练Day

    练习材料: [Day 1769 2019-07-31] Lesson 27-3The 'Vasa' As the ...

  • to some degree/extent

    title: to some degreedate: 2019-07-31 16:43:06NO_sents: 1...

  • 2019-08-02

    2019-07-31 毛雅亭 字数 565 · 阅读 14 2019-06-02 18:39 ...

  • 文先森的日常

    日精进打卡第365天 姓名:李文杰 (四爷); 公司:中国太平人寿; 日期:2019-07-31 【知~学习】 《...

  • 2019-07-31

    新时代新理念助生成长 靖宇374刘丽娟 字数 1681 · 阅读 0 2019-07-31 23:03 夏日的...

  • Mixin Network 月报 — — 第 5 期

    2019-07-01 ~ 2019-07-31 纪要 2019-07-06修复随机广播有的节点交易不确认的问题,会...

  • 第一次被惹哭

    2019-07-31 相处就是相互磨合, 磨平彼此棱角。 但是我不愿被磨平, 我依旧在被磨平; 我想磨平他, 但是...

  • 晨间随想

    时间:2019-07-31 周三 7;31 地点:湖北武汉 天气:晴天 状态:向往 关键字:飞翔 沉沉的一觉。 ...

网友评论

      本文标题:2019-07-31一些方法

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