offset

纯JS实现KeyboardNav(学习笔记)一

落花浮王杯 提交于 2019-12-05 18:11:40
纯JS实现KeyboardNav(学习笔记)一 这篇博客只是自己的学习笔记,供日后复习所用,没有经过精心排版,也没有按逻辑编写 GitHub项目源码 预览地址 最终效果 KeyboardNav使用指南: 左下角为网站的icon,'.'代表网站无icon或未设置网站 按键盘上相应的按键进入对应网站 鼠标放上去可编辑并保存网站,除了初始网站,用户编辑的网站存在本地cookies 清空cookies后保存在本地的网站将被清除,还原会初始状态 数据结构的使用 哈希,数组 做出来导航页面 实际上数组就是hash 数组带方括号其实是hash的一种简写. 且数组是对象. 报错学习 JS错误:没有被处理的 语法错误 :不期待的字符串] 意思就是这里不应该有字符串] 语法错误 css重要代码 text-transform: uppercase; /*文本小写变大写*/ #mainxxxx{ display: inline-block; } main{ text-align: center; } /*mainxxx这个div居中*/ #mainxxxx>div:nth-child(2){ margin-left: 1em; } #mainxxxx>div:nth-child(2) 代表 mainxxxx 的名为 div 的第二个子元素. 定位 kbd 里面的 button ,并添加 hover kbd

C#编程之WPF控件开发(十三)

孤人 提交于 2019-12-05 16:54:39
今天我们开始着手上一篇文章提到的实现用户动态按钮功能。 同样我们对上一章的代码进行修改按键特效。首先我们将原来的按键样式代码删掉,修改如下代码: 1 <Window.Resources> 2 <Style TargetType="Button"> 3 <Setter Property="Template"> 4 <Setter.Value> 5 <ControlTemplate TargetType="Button"> 6 <Border x:Name="Border" CornerRadius="20" BorderBrush="PaleGreen" BorderThickness=" 1"> 7 <Border.Background> 8 <LinearGradientBrush StartPoint=" 0,0.5" EndPoint=" 1,0.5" Opacity=" 0.5"> 9 <GradientStop Color="Green" Offset=" 0.0"/> 10 <GradientStop Color="White" Offset=" 1.0"/> 11 </LinearGradientBrush> 12 </Border.Background> 13 <ContentPresenter Margin="2" HorizontalAlignment=

简单记录下防止重复提交操作!

雨燕双飞 提交于 2019-12-05 16:29:47
思路:   1.以用户token+请求接口作为键,请求接口系统时间作为值   2.通过注解+aop实现对加入注解的接口进行拦截   3.首次请求将建+值存入redis,在次请求时取出时间,与设定的默认时间想比较,如果小于,则为重复提交,反之则放过 一、创建注解(设置默认时间) 二、创建AOP拦截类 import com.alibaba.fastjson.JSONObject;import com.orisdom.config.Constants;import com.orisdom.dto.ApiResult;import com.orisdom.modules.common.annotation.RepeatSubmit;import com.orisdom.utils.DateUtils;import com.orisdom.utils.RedisUtil;import com.orisdom.utils.StringUtils;import org.aspectj.lang.ProceedingJoinPoint;import org.aspectj.lang.annotation.Around;import org.aspectj.lang.annotation.Aspect;import org.aspectj.lang.annotation.Pointcut

【cocos2d-js官方文档】十四、cc.spriteFrameCache 改造说明

安稳与你 提交于 2019-12-05 15:01:59
统一引擎内部创建SpriteFrame的数据结构 将Plist的解析工作转移到了cc._plistLoader中去,对SAXParser进行了改造。 统一了引擎创建SpriteFrame的数据结构: { _inited : true, frames : { "a_frame_0.png" : { rect : {x : 0, y : 0, width : 1, height : 1}, rotated : false, offset : { x : 0, y : 0}, size : { width : 1, height : 1} aliases : ["a_f_0"] } }, meta : { image : "a.png" } } 引擎在创建SpriteFrame的时候,读取了plist配置文件的信息后,会将其转换为以上的数据格式。 自定义SpriteFrame的配置文件 采用 cc.loader 的插件机制,我们可以很轻松的自定义自己的配置文件格式。SpriteFrame的各种格式的配置文件,只要转换成对应格式就行了。 例如,我们自定义了一个文件,用于存储原本配置在多个plist( res/ui/tcc_issue_1.plist, res/ui/tcc_issue_2.plist )的SpriteFrame的打包信息, 名为 res/ui/imgs.pkgJson

Kafka offset存储方式与获取消费实现

不打扰是莪最后的温柔 提交于 2019-12-05 14:36:27
转载:http://www.aboutyun.com/thread-21104-1-1.html 1.概述 目前,Kafka 官网最新版[ 0.10.1.1 ],已默认将消费的 offset 迁入到了 Kafka 一个名为 __consumer_offsets 的Topic中。其实,早在 0.8.2.2 版本,已支持存入消费的 offset 到Topic中,只是那时候默认是将消费的 offset 存放在 Zookeeper 集群中。那现在,官方默认将消费的offset存储在 Kafka 的Topic中,同时,也保留了存储在 Zookeeper 的接口,通过 offsets.storage 属性来进行设置。 2.内容 其实,官方这样推荐,也是有其道理的。之前版本,Kafka其实存在一个比较大的隐患,就是利用 Zookeeper 来存储记录每个消费者/组的消费进度。虽然,在使用过程当中,JVM帮助我们完成了一些优化,但是消费者需要频繁的去与 Zookeeper 进行交互,而利用ZKClient的API操作Zookeeper频繁的Write其本身就是一个比较低效的Action,对于后期水平扩展也是一个比较头疼的问题。如果期间 Zookeeper 集群发生变化,那 Kafka 集群的吞吐量也跟着受影响。 在此之后,官方其实很早就提出了迁移到 Kafka 的概念,只是,之前是一直默认存储在

delphi key解密转c# 解决string 不可变长度问题

非 Y 不嫁゛ 提交于 2019-12-05 14:26:40
遇见问题: delphi的解密需要在c#里面实现 方法一:delphi编写delphi dll组件,c#里面调用 方法二:c#重写delphi的代码进行解析 方法一: delphi部分代码: library Project2; { Important note about DLL memory management: ShareMem must be the first unit in your library's USES clause AND your project's (select Project-View Source) USES clause if your DLL exports any procedures or functions that pass strings as parameters or function results. This applies to all strings passed to and from your DLL--even those that are nested in records and classes. ShareMem is the interface unit to the BORLNDMM.DLL shared memory manager, which must be deployed along with

开始nodejs+express的学习+实践(7)

百般思念 提交于 2019-12-05 13:39:16
1.分页显示数据 准备工作:启动数据库服务,打开mongo.exe,启动nodejs服务。 浏览器地址: http://localhost:1234/ 会看见显示的数据。 我们要做的是分页显示数据,在预览时我们经常看见,现在news集合只有3条记录,我们增加到10条,作为操作使用。 刷新看见数据全部进来了,我们可以着手分页的工作了。 我们先简单分析分页原理: 首先地址上有当前页参数(get方法) 如变量 currentpage=1第一页,地址变为localhost:1234/?currentpage=1; 每页显示个数 如变量 count=3; 然后就是当前页显示记录 公式(currentpage-1)*3 第1页 0-2记录 第2页 3-5记录 类推; 记录总个数/每页个数 等于总页数,不整除+1页。 我们修改index.js的首页处理,get获取当前页数: app.get('/',function(req, res){ var currentpage=req.query.currentpage?req.query.currentpage:1; model.model_index(currentpage,function(items){ res.render('index', { title: 'Express',hello: 'hello world!',arr: items

Undefined offset error, but offset is not undefined

て烟熏妆下的殇ゞ 提交于 2019-12-05 13:35:48
I'm getting: Notice: Undefined offset: 0 in my code, however I can print_r the element I am trying to get and its clearly defined. function get_members($entries_found) { $members = $entries_found[0]['member']; ... } If I print_r($members) I get the expected output, however I'm still getting the Notice. Any clues? Do var_dump($entries_found); To check that the array does indeed have an offset of zero. Other things you can try would be reseting the array pointer reset($entries_found); of checking if it's set first if (isset($entries_found[0]['member'])) // do things If all else fails you could

Cross Browser issue with jQuery offset()top returning different values

被刻印的时光 ゝ 提交于 2019-12-05 12:39:31
Essentially, what I'm trying to do, is apply a CSS class to an element in context to the scroll position of the document. Specifically, allowing my sidebar navigation to scroll to 20px below the top of the view port along with the rest of the content, at which point the element becomes of fixed position, thanks to the css class added, until the document is subsequently scrolled back up above that point, when the class is removed and the element again scrolls with the rest of the page content. I need the solution to be as light weight as possible and do not wish to use any library other than

What is prevObject and why is my selector returning that?

不想你离开。 提交于 2019-12-05 12:05:35
问题 I'm trying to obtain the top from an element but I'm getting this error, what does it mean and how do I get rid of it? $(".hover").offset().top >Uncaught TypeError: Cannot read property 'top' of undefined $(".hover") [div.hover, prevObject: x.fn.x.init[1], context: document, selector: ".hover", jquery: "2.0.3", constructor: function…] [prevObject: x.fn.x.init[1], context: document, selector: ".hover", jquery: "2.0.3", constructor: function…] This happens inside the drop event of jqueryui when