Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Prevent text/image selection...

Prevent text/image selection...

Scheduled Pinned Locked Moved Web Development
htmlquestionloungeworkspace
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Matt Gullett
    wrote on last edited by
    #1

    I need to setup a web page so that a user cannot select text AND images. I am currently using onselectstart="return false;" in the body tag and that works fine for text, but images can still be selected. This project is not a general purpose/public access website. I am building a kiosk-style system using HTML and Google Chrome as the browser. The system is designed to be interacted with via touch screen. Currently, if the user slightly moves their finger while touching an icon, the browser selects the icon and highlights it in blue. This isn't visually desirable. Is there a way to prevent this without modifying the Google chrome source code. I'm pretty sure I've seen sites that do something like this, but I can't find one right now and I'm just not sure what is the best method. Thanks

    A 1 Reply Last reply
    0
    • M Matt Gullett

      I need to setup a web page so that a user cannot select text AND images. I am currently using onselectstart="return false;" in the body tag and that works fine for text, but images can still be selected. This project is not a general purpose/public access website. I am building a kiosk-style system using HTML and Google Chrome as the browser. The system is designed to be interacted with via touch screen. Currently, if the user slightly moves their finger while touching an icon, the browser selects the icon and highlights it in blue. This isn't visually desirable. Is there a way to prevent this without modifying the Google chrome source code. I'm pretty sure I've seen sites that do something like this, but I can't find one right now and I'm just not sure what is the best method. Thanks

      A Offline
      A Offline
      Aman Bhullar
      wrote on last edited by
      #2

      Also use ondragstart="return false" It will solve your problem

      M 1 Reply Last reply
      0
      • A Aman Bhullar

        Also use ondragstart="return false" It will solve your problem

        M Offline
        M Offline
        Matt Gullett
        wrote on last edited by
        #3

        Thanks. That worked perfectly.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups