Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8802671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:08:32+00:00 2026-06-14T01:08:32+00:00

In this fiddle : http://jsfiddle.net/peey/bbseQ/1/ , i have tried to hyperlink a triangle made

  • 0

In this fiddle : http://jsfiddle.net/peey/bbseQ/1/ , i have tried to hyperlink a triangle made by css (using this snippet), which is basically left border of an element.

In the fiddle, as you can see, the actual area which is hyper-linked includes the red area shown in the second shape.

I am looking for a method with which i can hyperlink only the visible area or the right border. I think it might be possible using jQuery or plain JavaScript or even some other JavaScript library, but I’m not sure how.

Also, is there any way that HTML image maps could be used with elements, because if they can be, the i can use them to define the area to be hyperlinked.

Thank you.

Here is the html code :

<body>
I just want to link green, visible area    
<a href="#"><div class="arrow-right"></div></a>
But the actual hyperlinked area includes red:
<a href="#"><div class="arrow-right"></div></a>

<style>
.arrow-right{
    width: 0;
    height: 0;
    border-top: 60px solid transparent;
    border-bottom: 60px solid transparent;    
    border-left: 60px solid green;
}

a:last-child .arrow-right{
    background:red;
}
*{margin:10px;}
</style>
</body>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:08:33+00:00Added an answer on June 14, 2026 at 1:08 am

    Your question is good, but to solve it, I used some Math.

    Supposing this size of the border to be 60:

    var v = 60;
    $('a').on("click", function(event){
        var x = event.pageX - $(this).offset().left;
        var y = event.pageY - $(this).offset().top;
        if((x==y || x<y) && x<v && (x+y)<v*2) {
            console.log(x+" "+y);
        } else {
            console.log('out!');
            return false;
        }
    });
    

    The equation used for comparison will calculate if the click event is inside the arrow or not.

    DEMO here: http://jsfiddle.net/bbseQ/9/

    UPDATE: Works on Firefox too! Cheers 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made this fiddle http://jsfiddle.net/nAb6N/10/ As you can see I have 2 animators ,
I have this fiddle: http://jsfiddle.net/yub2B/4/ HTML: <input type=text /> <input type=text /> <input type=text
I have this fiddle : http://jsfiddle.net/XjeCf/1/ that works like I want and this one
I have isolated my problem in this fiddle http://jsfiddle.net/xYphz/ It uses the root model
Ok, I have this fiddle http://jsfiddle.net/25J3M/6/ , I want to position the red and
I have this fiddle: http://jsfiddle.net/9J5Fg/ When one box is open and I click on
See this fiddle: http://jsfiddle.net/uqJHf/ I have set the first column to show up with
I'm using this plugin for displaying tooltips Looking at this fiddle - http://jsfiddle.net/CmmUC/1/ You'll
I have the following javascript code found also in this fiddle: http://jsfiddle.net/periklis/k4u4c/ <button id
I have this fiddle: http://jsfiddle.net/y8Uju/5/ I am trying to save the numbers, because, when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.