disableselection jquery ui что это

Поскольку альтернативы не предложено, я предполагаю, что они имеют в виду, что это всегда плохо, но я не могу понять их причины. Двойной / тройной щелчок или иным образом бессмысленный выбор приложения с тщательно продуманным пользовательским интерфейсом неправильно применяет эффект выделения текста и (для меня) мгновенно устраняет иллюзию надежного взаимодействия с пользователем.

Настольные приложения от этого не страдают! Кнопки и другие элементы управления в среде рабочего стола представляют собой области пикселей, которые выглядят сплошными и действуют интуитивно, независимо от того, что вы с ними делаете (или они сломаны). Тот факт, что веб-приложения состоят из сложных html-блоков, фонов, границ и изображений (веб-аналог пикселей), не является причиной выдавать иллюзию, что элементы экрана, с которыми мы взаимодействуем, не являются атомарными физическими объектами.

1) Неправильно ли я истолковываю их решение? Является ли эта рекомендация более конкретной для JQuery, чем я думаю?

2) Если имеется в виду общее утверждение, что текст должен всегда быть таким, как этот, пожалуйста, предоставьте более полное объяснение, почему.

3) Если бы я все равно собирался это сделать, что было бы наиболее производительным, полным, уважительным, кроссбраузерным и универсально доступным, чтобы сделать это сейчас, когда disableSelection устарело?

4 ответа

Для этого в большинстве браузеров можно использовать CSS: http://jsfiddle.net/fQthQ/

Opera в настоящее время не поддерживает эту функцию.

Что ж, это хороший способ (тонкий инструмент) отговорить людей продолжать использовать OLD I.E. из-за того, что они упускают.

Я бы использовал параметр CSS, как объясняет @Shmiddty, но, возможно, он включен для начала и отключается по мере продвижения, но это только мое мнение 🙂

Источник

How to disable text selection using jQuery?

Does jQuery or jQuery-UI have any functionality to disable text selection for given document elements?

13 Answers 13

In jQuery 1.8, this can be done as follows:

If you use jQuery UI, there is a method for that, but it can only handle mouse selection (i.e. CTRL + A is still working):

The code is realy simple, if you don’t want to use jQuery UI :

I found this answer ( Prevent Highlight of Text Table ) most helpful, and perhaps it can be combined with another way of providing IE compatibility.

This could be also not enough for old versions of FireFox (I can’t tell which). If all this does not work, add the following:

The following would disable the selection of all classes ‘item’ in all common browsers (IE, Chrome, Mozilla, Opera and Safari):

Читайте также:  Что значит судебное заседание по делу завершено при банкротстве

This can easily be done using JavaScript This is applicable to all Browsers

Call to this function

This is actually very simple. To disable text selection (and also click+drag-ing text (e.g a link in Chrome)), just use the following jQuery code:

A quick snippet to show/prove this to you:

Please note that this effect is not perfect, and performs the best while making the whole window not selectable. You might also want to add

as well, by using that section of Vladimir’s answer above. (get to his post here)

Источник

пример: у меня есть неупорядоченный список, содержащий кучу входных данных формы.

7 ответов

Когда сортируемый список jQueryUI находится в середине операции перетаскивания, есть ли способ заставить jQuery обновить положение заполнителя, даже если пользователь перемещает мышь только горизонтально? (Хит-тестирование jQuery для вертикальной сортировки, похоже, работает только тогда, когда.

Небольшое улучшение от поста плагина Zack-jQuery

И полное решение есть:

jQuery UI 1.9

селектор = вход, таблица, li.

Я использую jqGrid с опцией sortableRows. Я также использую встроенное редактирование строк после добавления строк в сетку. Он работает для меня OK в Chrome, но потом я попробовал его в FireFox и обнаружил, что встроенное редактирование не работает. Щелчки по любой из редактируемых ячеек сетки.

У меня была та же проблема. Решение довольно простое:

Следующие действия отключат выделение для всего документа, но элементы ввода и выбора по-прежнему будут функциональными.

Полегче! просто сделай:

и замените «sortable_container_id» идентификатором элемента, который является контейнером всех элементов «sortable».

Довольно старый, но вот другой способ:

Похожие вопросы:

У меня есть список, который можно отсортировать. Я использую jQuery UI с виджетом, мышью, позицией, сортируемыми аддонами. CSS: #sortable < width : 550px; display: inline-block; >#sortable li, #add.

Я использую jQueryUI для создания сортируемого списка, и часть UI отлично работает в том смысле, что я могу сортировать элементы по желанию на веб-странице. Однако я не могу понять, как порядок.

Когда сортируемый список jQueryUI находится в середине операции перетаскивания, есть ли способ заставить jQuery обновить положение заполнителя, даже если пользователь перемещает мышь только.

Я использую jqGrid с опцией sortableRows. Я также использую встроенное редактирование строк после добавления строк в сетку. Он работает для меня OK в Chrome, но потом я попробовал его в FireFox и.

У меня есть список примерно из двадцати элементов, и я использую JqueryUI sortable для сортировки их с помощью функции перетаскивания, Он хорошо работает на IE и Firefox, но в Chrome, когда вы.

Я использую JQueryUi Sortable для сортировки галереи с помощью удобного перетаскивания. Вещь, которую я сортирую, выглядит так :

Я использую jqueryui-sortable. Я хочу получить конечный результат в виде массива. HTML :

Источник

Since there is no alternative suggested, I assume they mean that it is always bad but I cannot fathom their reasons. A double/triple-click or otherwise meaningless selection of an elaborate-UI application improperly applies the text-highlight effect and (to me) instantly removes the illusion of a robust user experience.

Desktop applications don’t suffer from this! Buttons and other controls in a Desktop environment are regions of pixels that look solid and act intuitively no matter what you do to them (or else they’re broken). The fact that web applications are composed of complex html boxes, backgrounds, borders, and images (the web-analog of pixels) is no reason to betray the illusion that the screen elements we interact with isn’t an atomic, physical object.

In the image below, arguably some of the text should be selectable, such as the paragraphs of text within panels which could be application data. But for some applications it would be a reasonable design choice that other parts, such as the text in buttons, tabs, accordion headers, and text behind modal dialogs would not be selectable. This especially applies to draggable/sortable kinds of behaviors.

1) Am I misinterpreting their decision? Is the recommendation more specific to JQuery than I realize?

2) If it is meant as a general statement that text should always be selectable like this, please provide a fuller explanation of why.

3) If I were going to do it anyway, what is the most performant, complete, respectful, cross-browser, and universally accessible to go about it now that disableSelection is deprecated?

4 Answers 4

You can use CSS to accomplish this in most browsers: http://jsfiddle.net/fQthQ/

Opera does not currently support this feature.

I know that it can be done without this method (otherwise it’d be impossible for the method to do it in the first place); but the reason I wanted to use disableSelection() is to concisely express my desire in a single place and have jQuery-UI handle my cross-browser compatibility issues rather than having to use a combination of several CSS rules and some JS (for IE7).

I believe this feature is deprecated because someone was annoyed at web sites that disable selection, and decided that this is not a practice they should encourage. It’s analogous to a web programmer refusing to support popular legacy browsers because they don’t want to encourage their use. Such a programmer would be fired, but you can get away with imposing your philosophy on others when you have power over a popular library. Deprecating this feature has the effect of making programmers who want to disable selection waste their time looking for an alternative method. By punishing evildoers, jQuery-UI will presumably make them change their ways, and our society will not be inundated with web sites that disable selection. So you see, there is a perfectly good rationalization, and whoever wrote «Disabling text selection is bad. Don’t use this.» in the official documentation can regard themselves as heroic. We’re the bad guys here.

Источник

vmtco / jquery.disableSelection Go PK Goto Github PK

Disable selection of text content within the set of matched elements.

License: Apache License 2.0

jquery.disableSelection’s Introduction

Disable selection of text content within the set of matched elements.

Contributors

Watchers

Recommend Projects

A declarative, efficient, and flexible JavaScript library for building user interfaces.

Vue.js

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

TensorFlow

An Open Source Machine Learning Framework for Everyone

Django

The Web framework for perfectionists with deadlines.

A PHP framework for web artisans

Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

javascript

JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

Some thing interesting about web. New door for the world.

server

A server is a program made to process requests and deliver data to clients.

Machine learning

Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

Visualization

Some thing interesting about visualization, use data art

Some thing interesting about game, make everyone happy.

Recently View Projects

jquery.disableSelection

Disable selection of text content within the set of matched elements.

Источник

Сказочный портал