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

  • Home
  • SEARCH
  • 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 8174289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:24:49+00:00 2026-06-06T22:24:49+00:00

When my website/web app displays a picture, I need to allow the users to

  • 0

When my website/web app displays a picture, I need to allow the users to define ‘hotspots’ on the picture wherever they click. So for example, when the user clicks on a point on the picture – 1cm² around the co-ordinate that was clicked will become a link. To be more specific – when the user clicks there to define the hotspot – a dialog will open asking for a string.

I’m pretty much open to all suggestions as to how I can achieve this but want to steer clear of flash, I know it’d be easily achieved in flash but if I can keep this all javascript/jquery it’d be a huge help.

Thanks a lot for any ideas.

For a bit more context: It will be developed using asp .net C# 4.

  • 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-06T22:24:53+00:00Added an answer on June 6, 2026 at 10:24 pm

    I chose a bit of a different approach than what Deceze said.

    Here’s the working jsFiddle outlining the process

    I really went above and beyond, mostly because deceze really got me thinking.

    This is the structure of the table. For our purpose, we named the table ‘coords’

    -------------------------
    |  id  |  xpos  |  ypos |
    -------------------------
    |  0   |   53   |  74   |
    |  1   |  217   |  168  |
    -------------------------
    

    This is the click function for the ‘Overlay’ sitting on top of the image. ->

    $("#imgOver").click(function(event) {
      var parentOffset = $(this).parent().offset(); 
      var defTop = event.pageY - parentOffset.top - 25;
      var defLeft = event.pageX - parentOffset.left - 25;
    
      $(this).append('<div class="addLink" style="top:'+defTop+'px;left:'+defLeft+'px;"> Link </div>')
      $.ajax({
        type: 'POST',
        url: 'hotspots.php',
        data: {'top' : defTop, 'left': defLeft  }
      });
    });
    

    In the above, we post the top and left values to our file to be parsed out and inserted into the DB. We can also create more relationships here, it’s just the ti of the iceburg.

    We define hotspots.php as the file to serve / handle our coordinate requests.

    This is the function to reteive the coordinates on page load and place them into the image.

    $.ajax({
      type: 'GET',
      url: 'hotspots.php',
      data: 'hotspots=true',
      success: function(data){
        $(data).appendTo('#imgOver');
        $.each($('#imgOver').find('.addLink'), function(i,obj){
          var coordData = $(this).attr('rel');
          coordData = coordData.replace(' ', '');
          coordData = coordData.split('/');
          $(obj).css({'top' : coordData[1]+'px', 'left' : coordData[0]+'px' });
        });
      }
    });
    

    This is the PHP code we’re using to insert, and parse data retrieved from the DB.

    if(!empty($_POST['top']) && !empty($_POST['left'])){
      $qstr = "INSERT INTO coords(xpos, ypos) VALUES('".$_POST['left']."', '".$_POST['top']."')";
      $q = mysql_query($qstr);
    }
    if(!empty($_GET['hotspots']) && $_GET['hotspots'] == 'true'){
      $qstr1 = "SELECT * from coords";
      $q1 = mysql_query($qstr1);
      while($row = mysql_fetch_array($q1)){
      ?>
        <div class="addLink" rel="<?php echo $row['xpos'] ?> /<?php echo $row['ypos'] ?>"> Link </div>
      <?php   
      }
    }
    

    Please note this is only an example, and not intended for production use. Obviously, you’ll have more than 1 image and will need to develop a relationship. Also, the SQL statements I’ve used are vulnerable and should be secured for live use.

    Good luck!

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

Sidebar

Related Questions

I have a Silverlight web app which uses ASP.net Website administration tool for user
I'm developing a web app (A) that serves as a front-end to another website
i have an asp.net website http://www.site.com . This web app is also running on
I have an Asp.Net web app which users include a script tag in their
I'm using jax-rs (jersey) to create a website / web-service that other users can
i have a web app that runs locally on our network. the way users
I'm trying to create a web filter app that will intercept an incoming website(one
I would like to build a web app that allows users to post THEIR
I'm using Omniauth with Devise to authenticate users via Facebook for a web app
I want to create a web-app (a website) used in house by staff only.

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.