zoukankan      html  css  js  c++  java
  • jquery与discuz冲去的解决方法

    把相应的JQUERY代码天下如下代码:

    <script type="text/javascript">
      jQuery.noConflict();
    </script>

    示例原jquery代码:

    <script type="text/javascript" src="http://www.juhutang.com/ /jquery-1.4.2.min.js"></script>
    <script type="text/javascript"> $(function() { countDown("2222/02/02 23:59:59", "#demo01 .day", "#demo01 .hour", "#demo01 .minute", "#demo01 .second"); countDown("2222/02/02 22:59:59", null, "#demo02 .hour", "#demo02 .minute", "#demo02 .second"); }); function countDown(time, day_elem, hour_elem, minute_elem, second_elem) { //if(typeof end_time == "string") var end_time = new Date(time).getTime(), //月份是实际月份-1 //current_time = new Date().getTime(), sys_second = (end_time - new Date().getTime()) / 1000; var timer = setInterval(function() { if (sys_second > 0) { sys_second -= 1; var day = Math.floor((sys_second / 3600) / 24); var hour = Math.floor((sys_second / 3600) % 24); var minute = Math.floor((sys_second / 60) % 60); var second = Math.floor(sys_second % 60); day_elem && $(day_elem).text(day); //计算天 $(hour_elem).text(hour < 10 ? "0" + hour: hour); //计算小时 $(minute_elem).text(minute < 10 ? "0" + minute: minute); //计算分 $(second_elem).text(second < 10 ? "0" + second: second); // 计算秒 } else { clearInterval(timer); } }, 1000); } </script>

    更改成如下代码:

    <script type="text/javascript" src="http://www.juhutang.com/ /jquery-1.4.2.min.js"></script>
    <script type="text/javascript">
      jQuery.noConflict();
    </script>
    <script type="text/javascript">
    jQuery(function(){
        countDown("2014/7/05 00:00:00","#demo01 .day","#demo01 .hour","#demo01 .minute","#demo01 .second");
        countDown("2014/7/05 04:00:00","#demo02 .day","#demo02 .hour","#demo02 .minute","#demo02 .second");
        countDown("2014/7/06 00:00:00","#demo03 .day","#demo03 .hour","#demo03 .minute","#demo03 .second");
        countDown("2014/7/06 04:00:00","#demo04 .day","#demo04 .hour","#demo04 .minute","#demo04 .second");
    });
    
    function countDown(time,day_elem,hour_elem,minute_elem,second_elem){
        //if(typeof end_time == "string")
        var end_time = new Date(time).getTime(),//月份是实际月份-1
        //current_time = new Date().getTime(),
        sys_second = (end_time-new Date().getTime())/1000;
        var timer = setInterval(function(){
            if (sys_second > 0) {
                sys_second -= 1;
                var day = Math.floor((sys_second / 3600) / 24);
                var hour = Math.floor((sys_second / 3600) % 24);
                var minute = Math.floor((sys_second / 60) % 60);
                var second = Math.floor(sys_second % 60);
                day_elem && jQuery(day_elem).text(day);//计算天
                jQuery(hour_elem).text(hour<10?"0"+hour:hour);//计算小时
                jQuery(minute_elem).text(minute<10?"0"+minute:minute);//计算分
                jQuery(second_elem).text(second<10?"0"+second:second);// 计算秒
            } else { 
                clearInterval(timer);
            }
        }, 1000);
    }
    </script>

    这些代码一定要放到discuz的common.js后面执行哦。。。。

  • 相关阅读:
    Oracle之配置节点间相互信任机制测试
    记crt 在windows与linux服务器之间利用ftp进行文件的上传下载
    虚拟机防火墙的相关设置
    Linux下载安装mysql5.7教程
    linux下使用Oracle常用命令
    Linux的常用命令
    ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/u01/app/oracle/product/19.2.0/db_1/dbs/initsanshi.ora'报错
    Linux下创建Oracle19C的数据库实例
    redhat7.6Linux安装Oracle19C完整版教程
    Python模拟登录的几种方法
  • 原文地址:https://www.cnblogs.com/php411161555/p/3878101.html
Copyright © 2011-2022 走看看