SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member Seinfeld's Avatar
    Join Date
    Jun 2004
    Location
    there's no place like 127.0.01
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question how can i make an element unselectable?

    I want to be able to create some widgets that are not selectable with the mouse, is there any method to do this in gecko based browsers and IE ?

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and your definition of a widget would be what? there are lots of ways to make STUFF disabled or unselectable but how to do it depends greatly on what that STUFF is.

  3. #3
    SitePoint Member Seinfeld's Avatar
    Join Date
    Jun 2004
    Location
    there's no place like 127.0.01
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Simple stuff like text and images, or a div with all elements unselectable for example. ( I don't refer here to inputs, that's simple input_elem.disabled = true)

  4. #4
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you mean stopping them from being able to copy and paste text, right click images and "save as" ???????

  5. #5
    SitePoint Member Seinfeld's Avatar
    Join Date
    Jun 2004
    Location
    there's no place like 127.0.01
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Quote Originally Posted by dc dalton
    So you mean stopping them from being able to copy and paste text, right click images and "save as" ???????
    Problem solved
    For Gecko (this is part of CSS3): style="-moz-user-select: none;"
    For IE: onselectstart="return false"


Bookmarks

Posting Permissions

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