zoukankan      html  css  js  c++  java
  • 编辑器制作问题

    1:让DIV占满屏幕

    $(window).height();$(window).width();可获取当前窗口大小,分别设为div的宽高即可。若父级元素无宽高,设置百分比无效。

    2:Backbone不跳转的单页路由是使用

    <a href="#xxx">实现的,一般没有#

    3:Backbone需要用return的方式将view的构造函数暴露出来(类似jquery暴露$)

    define(['jquery','backbone','underscore','main','bootstrap'],function($,Backbone,_){
    
        var MDView = Backbone.View.extend({
    
            el: 'body',
            template: _.template($("#markdown-temp").html()),
            events: {    
    
            },
            initialize: function(){
    
            },
            showView: function(){
    
                this.$el.html(this.template());
    
            },
            render: function() {
               
              }
        })
    
        return MDView;
    });
    require(['jquery','backbone','underscore','markdown','main','bootstrap'],function($,Backbone,_,MDView){
    
        var mainRouter = Backbone.Router.extend({
            routes: {
                'markdown': 'markdown',
                'host': 'host',
                'vm': 'vm',
                'temp': 'temp'
            },
            
            markdown: function(){
                $("body").html("<div class='low-poly' style='background-image:url(pic/low-poly.jpg);100%;'><button class='btn btn-default inmark' style='margin-left:45%;margin-top:35%;opacity:0.3'>Start</button></div>");
                $(".low-poly").css("height",$(window).height()+"px");
                $(".inmark").click(function keke(argument) {
                    mdviews.showView();
                })
            },
            
            host: function(){
                var li=$('.sidebar-items li').get(1);
                $(li).addClass('active');
                show.target = "host";
                host.showView();
            },
            
            vm: function(){
                var li=$('.sidebar-items li').get(2);
                $(li).addClass('active'); 
                show.target = "vm";   
                vm.showView();
            },
            
            temp: function(){
                var li=$('.sidebar-items li').get(3);
                $(li).addClass('active');
                show.target = "temp";
                temp.showView();
            }
        }); var MDView = Backbone.View.extend({
    
            el: 'body',
            template: _.template($("#markdown-temp").html()),
            events: {    
    
            },
            initialize: function(){
    
            },
            showView: function(){
    
                this.$el.html(this.template());
    
            },
            render: function() {
            
            }
        })
    
        var mdviews = new MDView();
        var router = new mainRouter();
        Backbone.history.start();
    })

     4:详细学习正则和MarkDown语法

    5:Markdown解析器:https://github.com/evilstreak/markdown-js

    浏览器端解析有问题?

  • 相关阅读:
    基于SpringMVC框架使用ECharts3.0实现堆叠条形图的绘制(下篇)
    使用Poi对EXCLE的导入导出
    使用JXL对EXCLE的导入导出
    在线API
    Java中使用poi导入、导出Excel
    SpringMVC框架下使用jfreechart绘制折线图,柱状图,饼状图
    让div在屏幕中居中(水平居中+垂直居中)的几种方法
    如何使用Canvas及动画实现
    $state、$watch、$scope、$rootScope分别是什么?
    【修真院“善良”系列之三】技术面试的时候该怎么样介绍自己?
  • 原文地址:https://www.cnblogs.com/cndotabestdota/p/5796805.html
Copyright © 2011-2022 走看看