jQuery实现右键菜单+遮罩+弹出层(适应管理系统界面)

全面解析:弹出窗插件与jQuery弹窗实现 本文还有配套的精品资源,点击获取 简介:弹出窗口是网页开发中的一种交互设计,用于显示消息、警告等。弹出窗插件简化了创建弹窗的过程,提供丰富的功能和自定义选项。本文深入探讨了弹出窗插件的原理、使用方法及在jQuery环境中的应用,包括lhgdialog插件的API使用和实例。强调了插件的可定制性,并通过代码示例展示如何在网页中实现弹出窗口。 1. 弹出窗口定义和应用... 阅读详情
    最近要做个某管理系统的界面,然后涉及到右键菜单,因为之前没有做过所以就做了一下~感觉还可以,不过我个人不是很喜欢右键菜单的这种形式。
    操作:在固定区域内点击鼠标右键出现菜单,然后选择任意一项后进行对应页面的跳转。刚开始的想法是用catch..case..的方法,对应不同的选项,只改变弹出层里的内容,但是内容都要用jQuery生成拼接,所以选用了比较简单的页面跳转。
    下面就只贴上一个示例页面的相关代码。

先上效果图:

这里写图片描述


**index.html主要代码**


<div id="myMenu" >
    <ul>
        <li>管理应用</li>
        <li>添加应用</li>
        <li>维护应用账号</li>
        <li>修改密码</li>
        <li>示例界面</li>
    </ul>
</div>
<div id="mask"> </div>
<div id="textbox">
主界面
</div>
**page_test.html主要代码**


<div id="textbox">
    主界面
</div>

<div id="maskbox">
    <div id='admin' class='module1'>
        <div class='top'>
            管理应用
            <img class="img_close" src="../images/close.png" alt="">
        </div>
        <div class='mid'>
            <div class='mid_left'>
                <div class='title'>应用分类:总部</div>
                <ul class='icon_list'>
                    <li><img src='../images/45x45/qq.jpg' alt=''> <span>QQ</span></li>
                    <li><img src='../images/45x45/qq.jpg' alt=''> <span>QQ</span></li>
                    <li><img src='../images/45x45/qq.jpg' alt=''> <span>QQ</span></li>
                    <li><img src='../images/45x45/qq.jpg' alt=''> <span>QQ</span></li>
                    <li><img src='../images/45x45/qq.jpg' alt=''> <span>QQ</span></li>
                    <li><img src='../images/45x45/qq.jpg' alt=''> <span>QQ</span></li>
                    <li><img src='../images/45x45/qq.jpg' alt=''> <span>QQ</span></li>
                </ul>
            </div>
            <div class='mid_right'>
                <div class='title'>添加应用</div>
                <div class="content">
                    <form action="">
                        <table>
                            <tr>
                                <td>应用机构:</td>
                                <td>
                                    <select class="text1" name="">
                                        <option value=""></option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>应用类型:</td>
                                <td>
                                    <select class="text1" name="">
                                        <option value=""></option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>应用名称:</td>
                                <td>
                                    <input type="text" class="text2">
                                </td>
                            </tr>
                            <tr>
                                <td>应用代码:</td>
                                <td>
                                    <input type="text" class="text2">
                                    <span class="point">(字母、数字及组合;唯一)</span>
                                </td>
                            </tr>
                            <tr>
                                <td>接入类型:</td>
                                <td>
                                    <select class="text1" name="">
                                        <option value=""></option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>超时时间:</td>
                                <td>
                                    <select class="text1" name="">
                                        <option value=""></option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>选择图标:</td>
                                <td>
                                    <input type="text" class="text2">
                                    <span>选择</span>
                                </td>
                            </tr>
                            <tr>
                                <td>应用地址:</td>
                                <td>
                                    <input type="text" class="text2">
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <input type="button" class="del button" value="删除">
                                    <input type="button" class="reset button" value="重置">
                                    <input type="button" class="save button" value="保存">
                                </td>
                            </tr>
                        </table>

                    </form>
                </div>
            </div>
        </div>
        <div class='end'></div>
    </div>
</div>
**reset.css代码(引入主页)**

*{
    padding: 0;
    margin: 0;
    font-family: '微软雅黑'
}
#mask{
    position: absolute;
    left: 0;
    top: 0;
    z-index: 9000;
    display: block;
}
#myMenu{
    position: absolute;
    display: none;
    z-index: 9999;
    background: white;
    border: 1px solid;
    width: 130px;
    height: 130px;
}
ul li{
    list-style: none;
    height: 25px;
    line-height:25px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 5px;
    border-bottom: 1px solid black;
}
ul li:nth-child(5){
    border-bottom:none;
}
#textbox{
    background: orange;
    width: 380px;
    border: 2px solid;
}
a{
    text-decoration: none;
    color: black;
}
a:hover{
    color: white;
    background: black;
}
**main.css代码(引入主页和跳转页)**

*{
    font-size: 16px;
    color:black;
    padding: 0;
    margin: 0;
    font-family: 微软雅黑;
}
/*.top{
    background: url("../images/close.png")760px center no-repeat;
}*/
.top img{
    float: right;
    margin-top: 13px;
    margin-right: 20px;
}
/*遮罩样式*/
#maskbox{
    position:absolute;
    left:0;
    top:0;
    height: 100%;
    width: 100%;
    background:rgba(0,0,0,0.6);
}

#maskbox .module1{
    width: 800px;
    height: 500px;
    border-radius: 15px;
    border: 1px solid #BFDCE3;
    margin: 0 auto;
    margin-top: 40px;
}
#maskbox .top{
    border-radius: 15px 15px 0 0;
    height: 46px;
    line-height: 46px;
    width: 800px;
    background-color: #F1F7F2;
    border: 1px solid #BFDCE3;
    text-indent: 20px;
}
#maskbox .mid{
    height: 418px;
    width: 800px;
    background-color: white;
    border: 1px solid #BFDCE3;
}
#maskbox .end{
    height: 36px;
    width: 800px;
    background-color: #F1F7F2;
    border-radius: 0 0 15px 15px ;
    border: 1px solid #BFDCE3;
}

.mid_left,.mid_right{
    display: inline-block;
    height: 418px;
}
.mid_left{
    width: 270px;
    float: left;
    border-right: 1px solid #BFDCE3;

}
.mid_right{
    width: 528px;
    border-right: 1px solid #BFDCE3;
}
.title{

    position: relative;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color:#DD9A6A;
    border-bottom: 1px solid #BFDCE3;
}

.mid_right .title{
    text-align: left;
    text-indent: 20px;
}
ul.icon_list{
    height: 377px;
    width: 270px;
    overflow: auto;
}
ul.icon_list li{
    border-bottom: 1px solid #BFDCE3;
    height: 72px;
    list-style: none;
    line-height: 72px;
    padding-left: 20px;
}
ul.icon_list li img{
    vertical-align: middle;
    margin-right: 20px;
}
.text1{
    width: 195px;
    height: 28px;
}
.text2{
    width: 192px;
    height: 28px;
}
.button{
    width: 80px;
    height: 28px;
    border-radius: 5px;
    background-color: white;
    border:1px solid #a8a8a8;
    font-size: 13px;
}
.point{
    font-size: 14px;
    color:red;
}
**test.css代码**

/*mid_right*/

table{
    margin-left: 15px;
}
table tr td{
    height: 35px;

}
table tr td:nth-child(1){
    height: 35px;
    width: 100px;
}
table tr td:nth-child(2){
    height: 35px;
    width: 390px;
}
table tr:nth-child(9) td{
    height: 100px;
    padding:  0 50px;
}
table tr:nth-child(9) .button{
    margin-right: 60px;
}
table tr:nth-child(9) .button:nth-child(3){
    margin-right: 0;
}
table span{
    font-size: 14px;
    color:deepskyblue;
}
table span.point{
    font-size: 14px;
    color:red;
}
**func.js代码(引入主页)**

//鼠标右击菜单
$(window).ready(function() {
    $('#myMenu').hide();
    $('#textbox').bind("contextmenu",function(e){
        //显示菜单
        $('#myMenu').show(500);

        //跟随鼠标位置
        $('#myMenu').css({
            'top':e.pageY+'px',
            'left':e.pageX+'px'
        });

        //屏蔽默认右键菜单
        return false;
    });
});
**main.js代码(引入主页)**

//获得选择的操作名
var check;
var checkmenu;
var choose = function(){
    $("#myMenu ul>li").bind('click',function(){
        check = $(this).text();

        page(check);

    });
};
choose();

var page = function(check){
/*
    //统一样式改变
    //右键列表隐藏
    $("#myMenu").hide();

    //出现遮罩
    $("#textbox").after("<div id='maskbox'></div>");
    checkmenu = 1;
    windowwidth = $(window).width();
    windowheight = $(window).height();
    $("#maskbox").css({
        'height': windowheight,
        'width': windowwidth
    });
*/

    switch (check){
        case "管理应用":
            page_admin();
            break;
        case "添加应用":
            page_add();
            break;
        case "维护应用账号":
            page_maintain();
            break;
        case "修改密码":
            page_modify();
            break;
        case "示例界面":
            page_test();
            break;
    }
};

var page_admin = function(){
    console.log("管理应用");
    window.location.href="page/page_admin.html";
};

var page_add = function(){
    console.log("添加应用");
    window.location.href="page/page_add.html";
};

var page_maintain = function(){
    console.log("维护应用账号");
    window.location.href="page/page_maintain.html";
};

var page_modify = function(){
    console.log("修改密码");
    window.location.href="page/page_modify.html";
};

var page_test = function(){
    console.log("示例界面");
    window.location.href="page/page_test.html";
};


//改变屏幕大小时
$(window).resize(function(){
    if(checkmenu == 1) {
        windowwidth = $(window).width();
        windowheight = $(window).height();
        $("#maskbox").css({
            'height': windowheight,
            'width': windowwidth
        });
    }
});
**com.js代码**

//统一样式改变
//右键列表隐藏
$("#myMenu").hide();

//出现遮罩
$("#textbox").after("<div id='maskbox'></div>");
checkmenu = 1;
windowwidth = $(window).width();
windowheight = $(window).height();
$("#maskbox").css({
    'height': windowheight,
    'width': windowwidth
});

//关闭弹窗 回到主界面
$(".img_close").bind("click",function(){
    window.location.href="../index.html";
});

//点击按钮后也回到主界面
$(".save").click(function(){
    window.location.href="../index.html";
});

移动端交互设计:使用jQuery实现下拉菜单选择功能 本文还有配套的精品资源,点击获取 简介:在移动设备上,由于触摸操作和屏幕空间限制,设计便捷的多级选择界面尤为重要。本代码通过利用jQuery库简化交互,配合触摸滑动事件处理,实现了从底部弹出的层级下拉菜单。详细解析了HTML结构、CSS样式和JavaScript逻辑的构建过程,以及响应式设计和性能优化的实现方法。同时强调了交互反馈的重要性,为移动应用或网站提供更丰富的用户体... 阅读详情

相关推荐

简单的jQuery响应式弹出菜单插件

简单的jQuery响应式弹出菜单插件

如何实现jquery自定义点击右键菜单显示

jquery自定义点击右键菜单显示其实很简单,只要下载一个smartMenu.js和一个smartMenu.css两个文件之后,将两个文件分别加入到css和js文件夹下面,然后在前台写上以下代码,就可以实现右键菜单的自定义了,代码如下:    $(“#user li”).bind("mousedown"                 , function (e) {            

yu13767514297的专栏 5262

树莓派4B+红外传感器:手把手教你DIY一个能走黑线的智能小车(Python代码全解析)

本文详细介绍了如何使用树莓派4B和红外传感器DIY一个智能循迹小车,包括硬件配置、GPIO连接、Python代码实现及优化算法。通过动态PWM调速、状态机设计和赛道记忆算法,提升小车的循迹性能和稳定性。适合初学者和电子爱好者动手实践。

weixin_29188043的博客 275

Jquery自定义元素右键点击事件

版权声明:转载请附上原文链接,谢谢;侵删。 https://blog.csdn.net/u014291497/article/details/52267604 &lt;/div&gt; &lt;div id="content_views" class="markdown_views"&gt; &lt;!--...

weixin_44112543的博客 1909

保姆级教程:用rosbag录制和回放你的第一个ROS机器人数据(附C++/Python代码)

本文提供了一份详细的ROS机器人数据录制与回放教程,涵盖从命令行操作到C++/Python编程实现的全流程。通过rosbag工具,开发者可以高效记录和回放机器人运行时的传感器数据和控制指令,适用于故障复现、算法调试等多种场景。教程还包含高级技巧如时间同步和大文件处理,帮助用户快速掌握ROS数据管理核心技能。

weixin_29313239的博客 290

什么是无人机巡检?如何实现无人机自动巡检?

复亚智能的无人机自动巡检系统通过高度自动化的技术,实现了无人机的高效巡检作业。无人机自动机场支持无人机的自动起降和电池更换,自动飞行算法确保无人机在复杂环境中的精准飞行和拍摄,而云端识别诊断和AI感知算法平台则实现图像的实时传输和智能分析。复亚智能,作为无人机技术的创新者和推动者,致力于开发先进的无人机自动巡检解决方案,助力各行各业实现智能化、自动化的巡检工作,引领智能巡检的未来。利用人工智能和机器学习算法,无人机可以被训练来识别特定的模式和异常,如结构损坏、热泄漏等,从而提高巡检的准确性和效率。

foiadrone的博客 2857

vue项目在微信上打开js方法中执行window.location.href后页面会没有反应,感觉有层透明的遮罩挡住,点击页面没反应,要返回下才有反应。

vue项目在微信上打开js方法中执行window.location.href后页面会没有反应,感觉有层透明的遮罩挡住,点击页面没反应,要返回下才有反应。或者是创建a标签执行点击页面也是没反应,要返回一下,页面才点得动。在网页上正常,唯独微信中不行。有遇到过这种情况的兄弟嘛。

baiyajin的博客 1321

别再死记硬背HBM测试流程了!用MK2/MK4设备实操芯片ESD防护,附IV曲线解读避坑

本文详细介绍了使用MK2/MK4设备进行芯片HBM测试的实操指南,重点解析ESD防护评估中的IV曲线解读与常见误判点。从设备初始化到测试全流程拆解,再到IV曲线的四段式深度分析,帮助工程师精准掌握芯片可靠性测试技术,避免操作误区,提升测试效率与准确性。

weixin_29221753的博客 595

Unity纹理生成工具Mixture深度评测与选型指南

在游戏开发与计算机图形学中,纹理(Texture)是构建虚拟世界视觉表现的基础元素,它直接影响着场景的真实感与艺术风格。其生成原理从传统的手绘、软件处理,发展到如今主流的程序化生成技术,通过数学函数与算法自动创建纹理,极大地提升了内容生产的效率与一致性。这项技术的核心价值在于将复杂的视觉设计转化为可参数化、可迭代的流程,降低了美术创作的技术门槛,并支持大规模资产的高效生成。在应用场景上,程序化纹理生成广泛适用于游戏开发、影视特效、模拟仿真等领域,用于快速创建地形材质、角色皮肤、UI元素以及各种环境细节。本文

weixin_30642869的博客 389

Qt5+OSG实战:如何用osgQOpenGLWidget在窗口中加载3D模型(附完整代码)

本文详细解析了如何在Qt5中使用osgQOpenGLWidget加载和渲染3D模型,涵盖环境配置、核心架构、性能优化及高级技巧。通过实战案例和完整代码,帮助开发者实现工业级3D模型渲染,提升Qt与OSG的整合效率。

weixin_42741930的博客 274

Playwright Test Agent 实战:零代码基础也能写自动化测试「喂饭教程」

本文详细介绍了Playwright智能体的三大核心组件:规划智能体设计测试策略,生成智能体转换用例为代码,修复智能体自动修正失败测试。教程包含环境配置步骤、智能体使用方法和实战案例,展示了如何通过自然语言指令快速创建稳定的测试脚本。相比传统方法,Playwright智能体大幅降低测试自动化门槛,提升效率并减少维护成本,使测试人员无需编码基础也能实现高质量的自动化测试。

blues_C的博客 2058

js实现进度条遮罩效果

摘要:现在需要在页面一加载的时候出现进度条,并遮罩整个页面,等加载完之后取消进度和遮罩。 思想:需要借辅助页面二,页面二加载的时候调用js方法init(),init做两个动作, 动作一:显示进度条和遮罩区域。 动作二:传递url,提交action到后台查询页面一的数据,当跳转到页面一的时候,加载页面一,调用页面二的js方法隐藏掉进度条和遮罩区域。 页面二的部分代码: //页面初始化 f

zhanglongfei1016的专栏 4301

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Vue 单页应用 axios请求时 全局遮罩层设计

系统需求: 在前端有请求时,并且请求还没有接收到响应时,需要显示个遮罩层,并显示加载状态,来屏蔽用户的操作;等所有请求都完成后,遮罩层消失,用户可以继续操作。 设计方案: 在主组件App.vue里,我们加一个遮罩层; 在store.state里加一个用来统计当前正在请求的个数 request_count ,这样我们就可全局来更新该变量,当有请求时 request_count + 1,当前有请求返回时request_count - 1 。 1、store/index.js ...

qzonemen 2354

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

利用Jquery特性根据左侧菜单栏点击展现右侧不同内容

擅用Jquery属性值

qq_37263478的博客 2044

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

简单文件下载如何加提示加遮罩

开发中 一个简简单单的下载文件 想必大都第一反应是location.href 有需求要想下载重提示文件正在下载 就要重写location.href了 下面方法针对IE10及以上都做了兼容处理 完美兼容IE 谷歌 function export(url) { // 添加自定义遮罩代码 alert('文件正在导出,请耐心等待....'); var xhr = new XMLHttpR...

weixin_42827159的博客 1282

解决弹出菜单被遮挡

<br />如果窗口中同时有Swing弹出式组件(比如菜单、下拉框)和重量级AWT组件,那么弹出窗口有可能会被重量级组件所遮挡。<br />例如:<br />如果是菜单或者下拉框,可调用JPopupMenu的静态方法setDefaultLightWeightPopupEnabled(false)将弹出的窗口强制为Canvas或者Window等重量级的AWT组件,这样就可以避免弹出窗口被别的AWT组件所覆盖。其他的弹出式组件都有对应的方法强制弹出重量级窗口。<br />import javax.swing.*

xushuang1987的专栏 3204

JS遮罩效果 (很强)

///*| -------------------------------------------------------------------| Dialog 浮动提示框 发布版本3 【功能说明】| -------------------------------------------------------------------| 支持浏览器 FF, IE, OP| 支持拖动,自定义标题,

闷骚的男 6630

为整个window添加背景遮罩

.shadow{ box-shadow:#666 0 0 10px; background:rgba(0,0,0,.5); width:100%; height:100%; position:fixed; z-index:2000; } div class="shadow">

u014033756的专栏 660

点击按钮,生效一次,遮罩层方法

$.ajax({ type:"POST", dataType: "json", url:"{:url('Service/center')}", data:{'record':record,'pid':pid,'pad':pad,'type':1}, beforeSend:function(){ $.mask_fullscreen(); ...

weixin_42464250的博客 1036

添加遮罩层

.shadeDiv{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; -moz-opacity: 0.15; opacity:0.15; filter: alpha(opacity=15);} .showDiv {

小菜鸟的博客 1719

jQuery 弹出层菜单

经典的Jquery弹出层菜单,附完整代码。预览效果效果网址:http://www.keleyi.com/keleyi/phtml/divmenu.htm jquery添加移除类的两个方法:addClass() 方法向被选元素添加一个或多个类。该方法不会移除已存在的 class 属性,仅仅添加一个或多个 class 属性。提示:如需添加多个类,请使用空格分隔类名。语法$(selector).addClass(class)参数 描述class 必需。规定一个或多个 class 名称。使用函数来添加类使用函数向被

xiaozhen0610的博客 716

java 树 右键菜单_jQuery实现自定义右键菜单的树状菜单效果

本文实例讲述了jQuery实现自定义右键菜单的树状菜单效果。分享给大家供大家参考。具体如下:这是一款基于jQuery的自定义右键菜单,在树状结构的子节点(下级没有节点)上单击右键才会弹出自定义菜单,而且菜单是自动根据鼠标位置来定位的。当鼠标在菜单以外的任意空白处单击一下后会自动消失。这里想特别说明一点所谓的“菜单以外”,可以有两种解剖方式——1、除了鼠标在菜单区域内的所有位置;2、如下图所示的A、...

weixin_34517026的博客 282

jquery重写自定义鼠标右键弹出菜单列表

生而为人 谁不付出 谁不努力 jQuery仿电脑桌面点击鼠标右键弹出菜单操作,可自定义添加右键菜单代码。需要使用到一个JS文件mouseRight.min.js 1:参数说明 itemname:表示右键菜单“名称”。 icon:新建项font-awesome图标样式如:fa fa-plus。(特别说明一点icon是要通过样式控制的,请到font-awesome.min.css你们查找)...

tanqingfu1的博客 1746
上一篇: jQuery实现图片轮播效果
下一篇: 倒计时(可应用于商品限时团购抢购以及一些需要倒计时的场景)
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址