|
|
|
Search E-Mail Icon
Image sizes: 256x256, 48x48, 32x32, 24x24, 20x20, 16x16
File formats: BMP, GIF, PNG, ICO
Purchase entire Search Icon Library now!
View Search Icon Library now!
Download demo icons
How do I prevent the browser to selecting text
If you are a web developer, you have probably arisen the need to prevent a user from text selection. Reservation that I do not mean a complete ban to protect the text, and a ban on the allocation of various signatures, inscriptions, etc. where selection is interfering with the interface and the user (usually with drag & drop, or select text when you double-click). This is especially true for Web applications, and in any case does not apply to news sites.
What can we do? Until now, little thought. But before turning to the new (for me personally) method, consider what opportunities combat text selection we offer browsers.
Internet Explorer
This browser provides us with two possibilities:
1. For the elements set unelectable attribute with a value on. But there is one nuance: the text block with this attribute can not separate (ie not start with the selection of the element, and click on this element will not remove the selection from the text if this is selected), but if it contains other elements (for example, harmless "SPAN, B, etc.) then the text in them can provide. Moreover, if the selection started with a block of text without such an attribute, then the text inside the block with unelectable attribute will also be highlighted. In such a situation, one solution - to put all (!) Elements of the attribute, which is inconvenient and not practical.
2. Intercepting events selectstart. In other words, adding an element onselectstart = "return false" (for example to BODY) prohibits the provision of the text inside it. Again, nuance: if you start to select text beyond the limits of such a unit, the text inside it stands out without any problems.
FireFox (web browsers on the engine gecko), Safari (web browsers on the engine KHTML)
These browsers have a better mechanism to prohibit the selection of text in any form. This is done through the CSS property is user-select with the value none, which is included in CSS3. But before this property is approved, browsers democratically made it his own chip engine called property-moz-user-select and-khtml-user-select, respectively. So, to disable select text inside the block, just write:
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
|
Copyright © 2006-2022 Aha-Soft. All rights reserved.
|
|
Individual Ready Icons
You can buy individual icons to suit your needs. Each icon is $1 when purchased individually.
Icon Usage Agreement
Large Weather Icons depict a number of weather conditions that are common for software, weather Web sites, and mobile gadgets. The images are available in all resolutions standard to Windows, Mac OS, and other platforms. The largest versions are huge 512x512 pixel icons with vector sources in Adobe Illustrator (.ai) format easily affordable and ready to be printed or used in presentations in highest quality.
Vista Toolbar Icons. A collection of practical and eye catching icons representing all basic operations required for surfing the internet or using various applications.
SibCode Medical Icon Library is a fantastic set of images that covers most of the possible medicine-related software needs. The choice of professionals at a reasonable price!
Business Icon Set is a collection of top- quality stock icons for use in programs and on websites. They are provided in a variety of formats, sizes and color schemes.
Make your software look as nice as Vista with icons crafted in the same style
|
|
|
|