jq获取实时宽度
发表于|更新于
|浏览量:
乐观使你倾向于幸福健康事业顺利,悲观使你倾向于绝望患病失败忧郁孤独懦怯——民谚
代码如下
1 | $(window).resize(() => { |

然后当我窗口大小发生变化时就会触发

相关推荐
2024-10-28
typescript-exercises(二)
亲善产生幸福,文明带来和谐。——雨果 题目: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566/*Intro: All 2 users liked the idea of the community. We should go forward and introduce some order. We are in Germany after all. Let's add a couple of admins. Initially, we only had users in the in-memory database. After introducing Admins, we need to fix the types so that everything works well together.Exercise: Type &q...
2023-06-21
hexo-bilibili-bangumi
练习是良好的老师。——贺拉斯 分享一个hexo插件: https://github.com/HCLonely/hexo-bilibili-bangumi hexo 番剧页面插件,可选数据源:Bilibili, Bangumi Demo 安装 1$ npm install hexo-bilibili-bangumi --save 配置 将下面的配置写入站点的配置文件 _config.yml 里(不是主题的配置文件). 12345678910111213141516171819202122232425262728293031323334353637383940414243bangumi: # 追番设置 enable: true source: bili bgmInfoSource: 'bgmApi' path: vmid: title: '追番列表' quote: '生命不息,追番不止!' show: 1 lazyload: true srcValue: '__image__'...
2024-07-03
js页面历史返回
历史是一堆灰烬,但灰烬深处有余温。——黑格尔 我们可以使用history.back()来进行页面返回 history的文档: History API - Web API | MDN 除了返回还可以前进 1history.forward(); 以及 12// 向后跳转一个页面(等价于调用 back())history.go(-1); 然后还有 12// 向前跳转一个页面,就像调用 forward()history.go(1); 当然传入0就是刷新 123// 以下语句都具有刷新页面的效果history.go(0);history.go(); 还有查看页面栈长度 1const numberOfEntries = history.length; 补充: 12345678910window.addEventListener("popstate", (event) => { alert(`位置:${document.location},状态:${JSON.stringify(event.state)}...
2024-11-04
typescript-exercises(九)
如果你要宽容别人的过错,就要把眼光放到自己身上。——佚名 题目: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170/*Intro: PowerUsers idea was bad. Once those users got ...
2025-05-26
vue-ueditor-wrap
会当凌绝顶,一览众山小。 —— 杜 甫《望岳》 https://github.com/haochuan9421/vue-ueditor-wrap vue-ueditor-wrap:轻松集成 UEditor 到 Vue 项目在 Web 开发中,富文本编辑器是许多应用的重要组成部分,尤其是在博客系统、内容管理平台(CMS)等场景中。作为经典的富文本编辑器,UEditor 功能强大,但在现代前端框架(如 Vue)中使用时可能略显复杂。 今天我们来介绍 vue-ueditor-wrap,一个基于 Vue 的封装组件,旨在让开发者轻松将 UEditor 集成到 Vue 项目中。 什么是 vue-ueditor-wrap?vue-ueditor-wrap 是一个 UEditor 的 Vue 封装组件,提供了简洁的 API 和灵活的配置选项。它解决了原生 UEditor 在 Vue 项目中的集成难题,让开发者无需处理复杂的初始化逻辑。 主要功能 快速集成:通过简单的配置,即可将 UEditor 嵌入 Vue 项目。 支持双向绑定:轻松实现 Vue 的 v-model 与 UEditor...
2022-06-25
fokus
死亡,就是你加上这个世界,再减去你。——卡尔维诺 分享一个好玩的开源项目,演示地址: https://lab.hakim.se/fokus/ 代码仓库:https://github.com/hakimel/Fokus 演示效果: 当我们在页面上框选时,会在页面上加个蒙版,高亮框选区域 使用方式,首先下载fokus.min.js 官方链接 备用链接 然后引用 1<script src="/js/fokus.min.js"></script> 最后编写代码(随便写点) 1234567891011121314151617181920212223242526272829303132333435363738394041<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" cont...
