There is a NEWS menu button (this block is circled in red). How to make only the blue area clickable?
2 answers
There is a special tag: area
- Now we know the word canvas, but forgot what an area is. - istem
- @istem is now so fashionable. Use jQuery to get the height of the block :) - lampa
- one
|
For example, determine the color in the click coordinate. If the color matches the blue - follow the link.
- what is it written on? Is there an example, or what functions to use? - Hancock888
- jQuery docs.jquery.com/Tutorials:Mouse_Position - Heidel to determine the coordinates of the mouse click
- you seem to have canvas in tags. To determine the coordinates of the mouse - you were given a link. To define the color in mouse coordinates: var imData = ctx.getImageData (mouseX, mouseY, 1,1) // red component var red = imData.data [0]; // green component var green = imData.data [1]; // blue component var blue = imData.data [2]; - new_user_1
- And if there is not one color, but a gradient? - Shock
- @Heidel is possible, but jQuery does not determine the coordinates, and does not even help with this. In your version, it only helps to choose the element. - lampa
|