前端学习(1002):简洁版滑动下拉菜单问题解决

快速滑动 不停切换

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><script src="./js/jquery.min.js"></script><style>div {width: 100px;height: 100px;background-color: pink;display: none;}</style>
</head><body><button>显示</button><button>隐藏</button><button>切换</button><button>移动切换</button><button>移动切换简化版</button><div></div><script>$(function() {$("button").eq(1).click(function() {$("div").slideUp();});$("button").eq(0).click(function() {$("div").slideDown();});$("button").eq(2).click(function() {$("div").slideToggle();});//鼠标切换$("button").eq(3).hover(function() {$("div").slideDown();}, function() {$("div").slideUp();});//stop必须放在动画的前面$("button").eq(4).hover(function() {$("div").stop().slideToggle();});});</script>
</body></html>

运行结果

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/421174.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

js bom and dom

以下的代码只是一些小的例子。我画了一张图来总结js大的结构 <!DOCTYPE html> <html><head><meta charset"UTF-8"><title></title><script>//Point 1 delayer and timer (BOM browser Object Model)var delayer;var tim…

leetcode 383 赎金信 C++

自己想的&#xff0c;一个思路两个解法&#xff0c;从字符串中的第一个唯一字符的思路搬过来的 one class Solution { public:bool canConstruct(string ransomNote, string magazine) {int table2[26]{0};for(int i0;i!magazine.length();i){table2[magazine[i]-a];}for(int …

Win32下 Qt与Lua交互使用(二):在Lua脚本中使用Qt类

话接上篇。成功配置好QtLuatoLua后&#xff0c;我们可以实现在Lua脚本中使用各个Qt的类。直接看代码吧。 #include "include/lua.hpp" #include <QWidget> #include <QApplication> #include <QFile> #include <QDebug>static int tolua_new…

1099. Build A Binary Search Tree (30)

1099. Build A Binary Search Tree (30) 时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains o…

mysql列属性auto(mysql笔记四)

常见的的是一个字段不为null存在默认值 没值得时候才去找默认值&#xff0c;可以插入一个null到 可以为null的行里 主键&#xff1a;可以唯一标识某条记录的字段或者字段的集合 主键设置 主键不可为null,声明时自动设置为not null 字段上设置 字段名 primary key定义完字段后 …

详解html结构之间的各个关系,层级关系(以列表为例)

<!DOCTYPE html> <html><head><meta charset"UTF-8"><title>层级关系查找元素</title></head><body><div id "div">hello<ul id ""><li>li1</li><li>li2</…

leetcode 242 有效的字母异位词 C++

和赎金信的思路一样 我想我本科时光是找不到女朋友了&#xff0c;哪怕是一个异性的好朋友也不会有了&#xff0c;男女比例4&#xff1a;1&#xff0c;哼 class Solution { public:bool isAnagram(string s, string t) {int table2[26]{0};for(char a:t){table2[a-a];}for(char…

1058. A+B in Hogwarts (20)

1058. AB in Hogwarts (20) 时间限制50 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueIf you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silve…

jquery post 同步异步总结

最近在测试,发现有些效果不对,最后发现是post的执行顺序问题,所以研究了下,写了以下总结 1.post被请求多次,解决方法: 连接加入随机数 rand""Math.random() $.post("/Control/webControl.ashx?rand "Math.random(), { Method: "LoginIn", Parem…

js对html节点的操作

<!DOCTYPE html> <html><head><meta charset"UTF-8"><title></title><style></style><script>function copy(){//克隆节点//1&#xff0c;得到要克隆的divvar div document.body.firstElementChild;//2,复制…

leetcode 141 环形链表 C++

两种方法一个空间O(n)&#xff0c;另一个O(1)&#xff0c;时间都是O(n)。 one class Solution { public:bool hasCycle(ListNode *head) {unordered_set<ListNode*>set;while(head){if(set.count(head))return true;set.insert(head);headhead->next;}return false;}…

1056. Mice and Rice (25)

1056. Mice and Rice (25) 时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueMice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map…

Java poi读取,写入Excel2003

Java poi读取,写入Excel2003 相关阅读&#xff1a;poi读写Excel2007:http://www.cnblogs.com/gavinYang/p/3576741.htmljxl读写excel2003/2007:http://www.cnblogs.com/gavinYang/p/3576819.html package com.gavin.operational.excle;import java.io.FileInputStream; import …

leetcode 21 合并两个有序链表 C++

因为迭代比较好理解 所以我们在这里用递归 class Solution { public:ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {if(!l1) return l2;else if(!l2) return l1;else if(l1->val<l2->val){l1->nextmergeTwoLists(l1->next,l2);return l1;}else{l2->…

1061. 判断题(15)

1061. 判断题(15) 时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, Yue判断题的评判很简单&#xff0c;本题就要求你写个简单的程序帮助老师判题并统计学生们判断题的得分。 输入格式&#xff1a; 输入在第一行给出两个不超过100的正整数N和M&…

css和 js 改变html里面的定位。

css和 js 改变html里面的定位。&#xff08;三种方式&#xff09; <style type"text/css">#div1{border: 1px aquamarine solid;/*固定定位&#xff1a;此元素在整个网页的位置不变,固定某处不动*/position : fixed;left: 20px;top: 10px;}#div2{/*相对定位&am…

终端I/O之行控制函数

下列4个函数提供了终端设备的行控制能力。其中&#xff0c;filedes引用一个终端设备&#xff0c;否则出错返回&#xff0c;errno设置为ENOTTY。 #include <termios.h> int tcdrain(int filedes); int tcflow(int filedes, int action); int tcflush(int filedes, int que…

js 正则表达式实现文本验证

<style>.spa{/*js来改变span颜色*/color: red;}</style><script type"text/javascript">function checkIn(obj){//失去焦点&#xff08;鼠标离开文本框&#xff09;时验证//文本框的值var val obj.value;//拿到文本框的名字&#xff0c;用来做swi…

1060. 爱丁顿数(25)

1060. 爱丁顿数(25) 时间限制250 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, Yue英国天文学家爱丁顿很喜欢骑车。据说他为了炫耀自己的骑车功力&#xff0c;还定义了一个“爱丁顿数”E&#xff0c;即满足有E天骑车超过E英里的最大整数E。据说爱丁顿自己的…

leetcode 203 移除链表元素 C++

注意第一个元素的处理方法 今晚还有四个题要做&#xff0c;来不及解释了&#xff0c;上代码 class Solution { public:ListNode* removeElements(ListNode* head, int val) {struct ListNode*prenew ListNode(0,head);struct ListNode*temppre;if(!temp->next) return null…