jQuery实例-简单选项卡-【一些常见方法(2)-练习】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="../../jq-practice/jq/jquery-2.2.1.min.js"></script>
<script>
$(function(){
$('.input1').click(function(){
var oLogin=$('<div class="login"> <p>用户名:<input type="text" /></p> <p>密码:<input type="text" /></p> <div class="closeIcon">X</div> </div>');
$('body').append(oLogin);
oLogin.css('left',($(window).width()-oLogin.width())/);
oLogin.css('top',($(window).height()-oLogin.height())/); $(window).on('resize scroll',function(){
oLogin.css('left',($(window).width()-oLogin.width())/);
oLogin.css('top',($(window).height()-oLogin.height())/ + $(window).scrollTop());
})
$('.closeIcon').click(function(){
oLogin.remove();
})
}) })
</script>
<style>
.login{
position: absolute;
width: 300px;
height: 300px;
border: 1px solid red;
}
.closeIcon{
position: absolute;
right: 0px;
top:0px;
}
</style>
</head>
<body style="height: 2000px;">
<input type="button" value="点击" class="input1"/>
<!--<div class="login">-->
<!--<p>用户名:<input type="text" /></p>-->
<!--<p>密码:<input type="text" /></p>-->
<!--<div class="closeIcon">X</div>-->
<!--</div>--> </body>
</html>

jQuery实例-简单选项卡-【一些常见方法(2)-练习】的更多相关文章
- Jquery&JS简单选项卡
结果,如图 为了明显,用绿色+红色 第一步:静态布局 先写html代码和css样式 要点一: ul li都为块级元素,可以用height,但是里面字体不居中,我们用line-height,即达到居中 ...
- Jquery实现简单选项卡
<html> <head> <meta charset="UTF-8"> <title>选项卡</title> < ...
- jQuery ajax调用后台aspx后台文件的两种常见方法(不是ashx)
在asp.net webForm开发中,用Jquery ajax调用aspx页面的方法常用的有两种:下面我来简单介绍一下. [WebMethod] public static string SayHe ...
- 三种动态加载js的jquery实例代码另附去除js方法
!-- 这里为你提供了三种动态加载js的jquery实例代码哦,由于jquery是为用户提供方便的,所以利用jquery动态加载文件只要一句话$.getscript("test.js&quo ...
- vue.js之生命周期,防止闪烁,计算属性的使用,vue实例简单方法和循环重复数据
摘要:今天是比较糟糕的一天没怎么学习,原因是学校的wifi连不上了~~.今天学习一下vue的生命周期,如何防止闪烁(也就是用户看得到花括号),计算属性的使用,vue实例简单方法,以及当有重复数据时如何 ...
- vue教程2-04 vue实例简单方法
vue教程2-04 vue实例简单方法 vue实例简单方法: vm.$el -> 就是元素 vm.$data -> 就是data <!DOCTYPE html> <htm ...
- PHP+jQuery开发简单的翻牌抽奖实例
PHP+jQuery开发简单的翻牌抽奖实例,实现流程:页面放置6个方块作为奖项,当抽奖者点击某一块时,方块翻转到背面,显示中奖信息,这个奖品是随机的,不是固定的. 在页面上放置6个奖项: <ul ...
- jQuery实现TAB选项卡切换特效简单演示
本文实例为大家分享jQuery实现TAB选项卡切换特效,供大家参考,具体内容如下 1.tab切换 on ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 ...
- JQuery常见方法
<!DOCTYPE htmi> <html> <head> <meta charset="UTF-8"> <title> ...
随机推荐
- Windows Server 2012配置开机启动项
1.运行 shell:startup 命令,如下:
- file_put_contents() failed to open stream: Permission denied 问题解决
很长时间没有写PHP了,今天突然有个需求要写一个保存文件的功能. function downloadFile( $url , $savePath = '' ) { $fileName = ge ...
- 学习Java设计模式的10条建议
设计模式在整个Java的学习路线图中扮演着承上启下的作用. 在整个软件生命周期中,唯一不变的就是变化.设计模式就是要在软件设计.编码中对现有问题的一种总结,并从中寻求应对变化的策略. 自己初次接触设计 ...
- [React Fundamentals] Development Environment Setup
In this lesson we'll setup a simple build process for converting our ES6 React components into ES5 u ...
- [020]转--C++ swap函数
原文来自:http://www.cnblogs.com/xloogson/p/3360847.html 1.C++最通用的模板交换函数模式:创建临时对象,调用对象的赋值操作符 template < ...
- Logistic Regression and Classification
分类(Classification)与回归都属于监督学习,两者的唯一区别在于,前者要预测的输出变量\(y\)只能取离散值,而后者的输出变量是连续的.这些离散的输出变量在分类问题中通常称之为标签(Lab ...
- WebAPI返回JSON的正确格式
最近打算用WebAPI做服务端接口,返回JSON供ANDROID程序调用,结果试了好几次JSONObject都无法解析返回的JSON字符串.看了一下服务端代码: public string Get() ...
- five kinds of IPC methods
Shared memory permits processes to communicate by simply reading and writing to a specified memory l ...
- Tomcat启动报错 Failed to start component [StandardServer[8005]]解决
SEVERE: The required Server component failed to start so Tomcat is unable to start. org.apache.catal ...
- MATLAB-ginput函数问题
functions:Graphical input from mouse or cursor ginput提供了一个十字光标使我们能更精确的选择我们所需要的位置,并返回坐标值.函数调用形式为: [x, ...