• 这几天的工作总结:


    1、ios下input会有圆角的问题.

    -webkit-appearance:none;

    2、阻止冒泡:

    event.cancelbubble=true;

    event.stopProgration();

    3、阻止默认事件:

    例如 input type=“submit” 提交时,不符合条件的数据不提交,只有符合条件的数据提交。 如果不符合 弹出提示+阻止默认事件,符合上传。

    event.preventdefault();

    return false;

    4、require.js

    index。html

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
            <title>参与记录</title>
            <script type="text/javascript" src="js/glo_view.js" ></script>
            <script src="lib/require.js" data-main="js/main.js"></script>
        </head>
        <body>
            <div id="container"></div>
        </body>
    </html>

    main。js

    require.config({
        
        paths:{
            underscore:'../lib/underscore',
            jquery:'jquery-3.1.0.min',
            backbone:'../lib/backbone',
            text:'../lib/text',
            swiper:'swiper-3.3.1.min',
        }
    });
    require(['backbone','../js/router'],function(){
        Backbone.history.start();
    })

    router。js

    define(['backbone','jquery'],function(Backbone,$){
        var Router=Backbone.Router.extend({
            
            routes:{
                '':'home',
                },
        });

        home:function(){
          require(['model/render.js'],function(render){
          render.home();
          })
        },

    var router=new Router();
        
        return router;
    })        

    render.js

    define(['text!../../view/zhucesuccess.html'],
    function(zccghtml){
        function jifenduihuan(){
            $('#container').html(jfdhhtml);
            Glo_tools.toback('.topleft');
            Glo_tools.jifenduihuan();
            Glo_tools.topZero();
        };
        return{
            canyujilu:canyujilu
                   } 
    })    

    功能组件js

    define([], function() {
    
        function input(){
            $('.input-text').bind({
                focus: function() {
                    if(this.value == this.defaultValue) {
                        this.value = "";
                        $(this).css('color','#3c3b3b');
                    }
                },
                blur: function() {
                    if(this.value == "") {
                        this.value = this.defaultValue;
                        $(this).css('color','#b3b3b3');
                        if($(this).val()=='起始时间'||$(this).val()=='截止时间'){
                            $(this).css('color','#3c3b3b');
                        }
                    }
                }
            });
        }
    
        return {
            input: input,
    
        }
    
    })

    或者

    define(['jquery'],function($){
        function Glo_tools(){
        
        };
        Glo_tools.prototype={
        topZero:function(){
            $(window).scrollTop(0+'px');
        },
        };
        var dbTools=new Glo_tools();
        return dbTools;
    })    
  • 相关阅读:
    C语言实现奇偶交换_艾孜尔江撰
    图形学变换中的Homogenize方法_艾孜尔江撰
    解决VS Code中字符乱码的情况_艾孜尔江撰
    C++中设置Main函数结束后执行的代码_艾孜尔江撰
    SVN常用命令集合_艾孜尔江撰
    双指旋转操作的核心
    go写一个简单的HTTP服务器
    MD5加密算法
    C++撰写的简易图书管理系统
    Windows系统cmd中运行ssh命令显示不是内部或外部命令,也不是可运行的程序
  • 原文地址:https://www.cnblogs.com/gaidalou/p/6053897.html
Copyright © 2020-2023  润新知