Ways to conceal the cursor on an image map hotspot

Check out my project on jsFiddle

I am developing a web application specifically for touchscreen devices, which eliminates the need for a mouse on the screen.

To hide the cursor throughout the entire page, I am using cursor:none;. However, this method does not work on an image map area.

Each area is created as follows:

<area shape="rect" onclick="buttonPressed_DigitalKeyboard('Q');" coords="14,13,94,93" alt="" href="#">

The cursor reverts to a normal pointer when I remove the href="#", but the href attribute is required for validation purposes.

You can view an example of the issue in this Fiddle

Do you have any suggestions?


[EDIT] Please note that I am limited to working with Google Chrome due to HTML5 FileSystem support and other necessary features.


[EDIT 2]

The workaround mentioned by Greger, using a 1x1 pixel with an opacity of 1, also did not resolve the issue
View updated version on jsFiddle

Answer №1

Here is the jsfiddle link

To remove cursor for area-tags, you can use:

* {
  cursor: none;
}

[UPDATE]

It is recommended to use javascript instead of map/area-tags. Here's an example:

$("img#appkeyboard").click(function(e) {
    var off = $(this).offset();
    var cx = e.clientX - off.left;
    var cy = e.clientY - off.top;
    if (cy > 17 && cy < 99) { // 1 row
        if (cx > 17 && cx < 99) {
            alert("button Q is pressed!");
        } else if (cx > 56 && cx < 202) {
            alert("button W is pressed!");
        }
        // ....
    } else if (cy > 114 && cy < 195) { // 2 row
        if (cx > 52 && cx < 135) {
            alert("button A is pressed!");
        } else if (cx > 155 && cx < 237) {
            alert("button S is pressed!");
        }
        // ....
    } else if (cy > 211 && cy < 291) { // 3 row
        if (cx > 90 && cx < 170) {
            alert("button Z is pressed!");
        }
        // ....
    }
});

Check out this example on jsfiddle: here

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is the .includes() method executed in a change detection loop even when the related variable remains constant? / Considerations for replacing .includes()

Within my component file, there is a variable called user_roles that receives data from an API during ngInit() and remains unchanged afterwards. this.service.getUserRoles().subscribe( data => { this.user_roles = data; } ) The us ...

The Android browser is failing to load a Jquery Mobile page using XHTML

Review the code snippet below for an XHTML page named page1.xhtml. This page includes Jquery Mobile scripting: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Page 1</title> ...

Is there a way to create a function in JavaScript that can iterate through all node elements within a node collection?

Trying to ask a question in English when only having half knowledge of the language can be quite confusing. Therefore, I aim to create a function that can differentiate between a single node or a collection of nodes as its parameter and then retrieve the d ...

Error: Label out of place in Material-UI Select

Can anyone help me understand why the Select label is misplaced in MUI5? https://i.sstatic.net/gvqff.png This is the Textfield label: https://i.sstatic.net/zrgqF.png This is the Select label: https://i.sstatic.net/GspRC.png Here is the code snippet: ...

CSS not being applied properly in Devise(Rails) emails when sent to Gmail addresses

Upon a user signing up, I send a confirmation email using Devise's mailer view. While everything else appears to be functioning properly, the CSS for CONFIRM ACCOUNT doesn't seem to be applied at all. I've read that CSS classes cannot be use ...

A guide on making interactive circular SVG image displays

I have a collection of svg files that fit together like pieces of a puzzle to form a circle. What would be the most effective way to arrange them? I attempted placing the segments within a ul with each on top of one another. Since the segment svgs are alre ...

What's the best way to group rows in an angular mat-table?

I am working on a detailed mat-table with expanded rows and trying to group the rows based on Execution Date. While looking at this Stackblitz example where the data is grouped alphabetically, I am struggling to understand where to place the group header c ...

What is the best way to extract a CSS rule using PHP?

Below is an example of the stylesheet I am currently using: #thing { display: none; } I am looking to retrieve the value of the 'display' property using PHP instead of Javascript. While I know how to do this with Javascript, I would prefer to u ...

How to Resize Images in Internet Explorer and Firefox Using CSS

Having an issue with CSS formatting on Internet Explorer and Firefox. I am trying to create a navigation bar with several images displayed in a column, using a background image. I positioned the background image on the page and then created a div inside it ...

Is it possible to create a popup without using JavaScript?

Is it feasible to create a popup window without utilizing JavaScript by using the href tag or a similar method? For example, could something like <a href="popup:http://stackoverflow.com">Stackoverflow Popup</a> be used where the popup: functio ...

What is the process for using jQuery to systematically alter the src attribute of all avatar images on Twitter.com?

Summary: I am learning JavaScript and jQuery, and wanted to write a script to replace "_normal.png" with ".png" for all "img.avatar" images on Twitter.com. I encountered an error which I will explain below. Background: Practice makes perfect, so I like to ...

What is the best way to find the Selenium Webdriver element for the following HTML/jQuery snippet?

After numerous attempts with xpath, I am consistently encountering the noelementfoundexception error. My next strategy is to attempt clicking on Section 2. ...

The data entry is not displaying on my mobile app

I have developed my mobile application using html5, css3, and jquery mobile. I already have a desktop version and now I want to create a mobile application. Can php not be used with html5 for mobile applications? If that is the case, can I use ajax to ca ...

Ways to update CSS using alternate classes without relying on !important

I have a generic form in my code that styles all my buttons uniformly: input[type="button"],put[type="button"]:active,input[type="button"]:hover { width: 172px; height: 37px; line-height: 2 !important; margin: 11px 0px 0px 0px; padding ...

Using CSS or JavaScript to create dynamic animations on a web page

Feeling a little lost here... I've heard that some browsers don't fully support CSS animations. So, when it comes to animation, should I go with CSS or JavaScript? I'd love to hear your thoughts on the pros and cons of each option. ...

Combine variables within an attribute of an Angular component

I have searched high and low for a solution, but my dilemma persists. Here is my issue: Within my HTML template in Angular, I am trying to pass a series of data to the metadata property of a button. However, I am struggling to concatenate the variable con ...

Encountering a blank page issue when submitting form on a website using POST method

I had an idea to implement a save feature for my flashcard app. My initial solution was to store information about each card added, so that the app could retrieve this data upon starting and present the flashcards in the same format they were left in. I se ...

Using Angular 5 to retrieve data and dynamically fill form fields

I need assistance with populating form fields using information from a GET request. When a user inputs an object ID from the API, I want all corresponding fields (such as name, age, phone, etc) to be automatically filled with that object's data. For ...

Loading a Div Element on the Fly

I have a variety of checkboxes that are generated through iteration from a collection using the foreach loop of the core tags in JSP with parameters ID (which represents the ID of the checkbox) and key. Both the ID and key are dynamically populated based o ...

transferring the form data to another page using AngularJS

My form consists of inputs, and in AngularJS, I am looking to pass a parameter in the URL. However, I have managed to pass the parameter in the URL but not in the desired way. Below is my code snippet: <form action="#/report" method="get"> <sel ...