近期需开发一个DIV做的编辑器,插入表情图片可直接预览效果,仔细参考了下百度贴吧的过滤粘贴过来文件的THML代码,自己整理了下.写出来只是和大家分享下,我自己也不大懂,经过努力,幸好搞定. 蛋疼的事情出来了,当编辑框失去焦点时候,再插入图片时候总是插入在最前面(谷歌和火狐,IE没问题).还没搞定,,, <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/…
一些 Windows 系统不常见的 鼠标光标常数 Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As LongConst IDC_HAND As Long = 32649& '光标Hand If X Mod 2000 > 1700 Then SetCursor 191 '65581 ' TabStrip1.Tabs.Item(CurTab).Image = 3…
C# 设置鼠标光标位置 using System.Drawing; using System.Runtime.InteropServices; namespace ZB.QueueSys.Common { public class MouseHelper { private static MouseHelper instance; public static MouseHelper Instance { get { if (instance == null) instance = new Mou…
众所周知,Text Field 和 Text View 的光标颜色默认都是系统应用的那种蓝色,如图: 而在实际开发中为了让视觉效果更统一,我们可能会想把那光标的颜色设置成和界面色调一致的颜色.其实在 iOS 7 以后只需要一行代码便可以轻松实现: view.tintColor = [UIColor greenColor]; // view是你要修改的 Text Field 或 Text View 或者使用UIAppearance代理直接修改App中所有实例的光标颜色: [[UITextField…
一.关于浏览器的兼容性 目前主要有3种关于range的类似的对象,分别是W3C range 对象,Mozzlia selection ,ie TextRange 关于这三种的区别,请查看文档 http://www.quirksmode.org/dom/w3c_range.html 这里面对这三个是说的很清楚的 可以看出 Mozilla 的 range 是一个selection对象 ,而在ie下 range 是一个 text Range 这个和Mozilla是完全不同的,所以需要为这两种类型的ra…
升级了Sublime Text 3,结果光标变成了这个样子,非常不习惯: 查了文档http://www.sublimetext.com/3 ,Build 3059中得描述: Added settings caret_extra_top, caret_extra_bottom and caret_extra_width to control the caret size 意思是增加了caret_extra_top caret_extra_bottom caret_extra_width 这三个设置…
<p> <div id='text' contenteditable=true style='width:100px;height:100px;border:1px #ccc;'>abc</div></p><script> function test1(){ var div = document.getElementById("text"); var range = document.createRange(); var le…
[System.Runtime.InteropServices.DllImport("user32.dll")] //引入dll public static extern int SetCursorPos ( int x , int y ); void Update() { SetMouseToAnyOfScreenPosition(); } void SetMouseToAnyOfScreenPosition() { SetCursorPos ( 20 , 20 );//放在upda…
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; /// <summary> /// **************************UGUI拖动图片,脚本挂在Image上即可********************************* /// </summary&…
using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; using UnityEngine; using UnityEngine.Events; using UnityEngine.EventSystems; using UnityEngine.UI; /// <summary> /// 文本控件,支持超链接.图片 /// </summ…
public class Main : MonoBehaviour { public Texture2D cursorTexture;//图片 public CursorMode cursorMode = CursorMode.Auto; public Vector2 hotSpot = Vector2.zero;//以左上角为目标的偏移量 void Start() { //设置光标 Cursor.SetCursor(cursorTexture, hotSpot, cursorMode); }…
经常会遇到,光标就莫名消失了,得重启 IntelliJ IDEA 才行,到官方论坛询问才得知,系统时间如果被调前就会发生这个情况,我想原因是之前的破解是用的调系统时间的方式,所以留下了这个bug,总之,把系统时间调准后,IntelliJ IDEA 的光标就回来了.接下来我把系统时间同步问题解决就一切 OK 了.…