Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2005
    Posts
    153
    Thanks
    26
    Thanked 0 Times in 0 Posts

    Prevent selection

    Hello,

    Is there anyway to prevent images, words, divisions, etc from being selected? Also if something is selected is there a way to deselect?

    Thanks!

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,065
    Thanks
    36
    Thanked 498 Times in 492 Posts

    Question Huh?

    I'm not sure I understand your question.
    Can you give an example of what it is that you are trying to do?

  • #3
    Regular Coder
    Join Date
    Jun 2005
    Posts
    153
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Alright, let's say I took my mouse, push down on the left button and drag it across the screen. Everything is now hilighted in blue. Is there a way onmouseup that I could un-hilight these.

    Thanks

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,593
    Thanks
    0
    Thanked 645 Times in 635 Posts
    No there isn't. Some browsers do have a proprietary call you can make from JavaScript to do it but only if your visiitor enables the option to allow it.

    The answer to any "how can I prevent my visitors from doing something" is always no because they can always disable the code you use to attempt to do it because they are the ones in control of everything except your content. Their JavaScript and CSS always overrides yours.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • Users who have thanked felgall for this post:

    questionable (01-03-2012)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •