zoukankan      html  css  js  c++  java
  • 这几天的工作总结:

    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;
    })    
  • 相关阅读:
    SQL exists( select 1 from
    svn不知道这样的主机
    SVN 操作指南
    SVN导出/导入、SVN备份/还原 【小白版】
    Asp.net窄屏页面 手机端新闻列表
    装饰者模式
    适配器模式
    原型模式
    建造者模式
    抽象工厂方法
  • 原文地址:https://www.cnblogs.com/gaidalou/p/6053897.html
Copyright © 2011-2022 走看看