designMode

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-12 07:12:42

软件介绍

Cross-browser designMode

What is designMode?

Almost all major browsers offer a de facto support for rich text editing, which makes an entire DOM document editable. It was originally developed for Internet Explorer, however, later implementations by other browsers are proven to be surprisingly compatible and stable. The functions in this plugin can help you turn any frame, iframe or window into a cross-browser wysiwyg editor.

This technique can be referred to as designMode, because it's triggered by setting the designMode property of a DOM document to 'on' using JavaScript. The content can be modified by a set of commands using the execCommand() function. Mozilla provides a good specification of avalible commands.

What this plugin does

There are some browser differences related to designMode. This plugin handles such stuff in a cross-browser way, combined with the flexibility of jQuery.

Although complete wysiwyg editors require lots of work, this plugin provides the very basic functionality to be used as a part of something more advanced.

At least the following browsers have full or limited support for designMode:

  • Internet Explorer 6+
  • Firefox 1.5+
  • Safari 1.3+
  • Opera 9+

There are three jQuery functions to be used on any frame, iframe or window:

  • contentDocument() - access the DOM document of an element.
  • designMode() - set the designMode property. Chaining supported.
  • execCommand() - execute designMode commands. Chaining supported.

Examples

In these examples, #foo is either a frame, iframe or window (created by window.open for instance).

$(window).designMode('on') //Activate designMode of current page
$('#foo').designMode(); //Mode is optional, defaults to 'on'
$('#foo').execCommand('formatblock', '<p>'); //Execute command, with optional parameter
$('#foo').designMode().execCommand('bold'); //Chaining: Activate + execute
var doc = $('#foo').contentDocument(); //Access the DOM document

本文地址:https://codercto.com/soft/d/23193.html

微信小程序运营与推广完全自学手册

微信小程序运营与推广完全自学手册

王洪波 / 电子工业出版社 / 2018-6 / 59

本书是运营管理方面的书籍,将小程序的运营推广问题置千小程序的整个运营管理体系中来谈,主要讲述小程序的定位规划、营销吸粉策略、评估优化这三大方面的内容,这三方面的内容之间是三位一体、密切相关的。 书中通过列举丰富且具有代表性的小程序实际案例来向读者提供些可行的运营推广办法。案例涉及美食类、电商类、旅游类、媒体类等小程序,可供多个行业的小程序运营者参考借鉴。 书中所提供的各种小程序营销策略......一起来看看 《微信小程序运营与推广完全自学手册》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具