I was just wondering if there is anyway to do an AREA SHAPE COORDS with an onClick without using an image. For instance, I want to basically be able to click on the page somewhere (not on an image) and be able to do an onClick. Is this possible at all? If I just had a page with a plain colored background and nothing else on it, could I designate some area on that page using coordinates to perform an onClick?
still_learning
0
Junior Poster in Training
Recommended Answers
Jump to PostHave an empty div with an online attribute ie.,
<div style='height:100px;width:100px;position:absolute;top:0px;left:50px;z-index:9' onclick='window.location="www.google.com";'> </div>
With that, if someone clicks anywhere in that 100x100 box 50 pixels from the left edge they will go to Google.
Jump to Postgive the <div> tag a black border and background just so you can see where it is for testing purposes, you might be misclicking
Jump to PostNot sure, just tested it and it works fine works.
All 9 Replies
ShawnCplus
456
Code Monkey
Team Colleague
still_learning
0
Junior Poster in Training
still_learning
0
Junior Poster in Training
ShawnCplus
456
Code Monkey
Team Colleague
still_learning
0
Junior Poster in Training
ShawnCplus
456
Code Monkey
Team Colleague
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
still_learning
0
Junior Poster in Training
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.