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 9005561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:10:43+00:00 2026-06-16T01:10:43+00:00

I want to highlight that portion of a mapped image whose id is retrieved

  • 0

I want to highlight that portion of a mapped image whose id is retrieved from mysql database.
I have stored the id in $loc variable. Now using jquery selectors I want to pass this php variable in my jquery selector so that it will highlight the portion of image having the same id as in $loc.
Here is my working code:

    <script type="text/javascript" src="jquery.js"></script>
 <script type="text/javascript" src="jquery.maphilight.js"></script>
<script type="text/javascript">
 $(function () {
        $(".mapping").maphilight();


    $(".hoverable").css("border", "3px solid red");


    var data = $('#cr2').data('maphilight') || {};  
    data.alwaysOn = !data.alwaysOn;
    $('#cr1').data('maphilight', data).trigger('alwaysOn.maphilight'); // portion to always highlight (I WANT TO PASS THE PHP VARIABLE $LOC INSTEAD OF '#CR1'

});<area shape="poly" id="cr1" class="room" coords="549,272,489,334,534,377,594,316" href="www.msn.com" target="_top" alt="CR1" name="room-1">

  • 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-16T01:10:44+00:00Added an answer on June 16, 2026 at 1:10 am

    Replace #cr1 with #<?php echo $loc ?>

    Instead of:

    $('#cr1').data('maphilight', data).trigger('alwaysOn.maphilight');
    

    Use:

    $('#<?php echo $loc ?>').data('maphilight', data).trigger('alwaysOn.maphilight');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that i want to highlight during onmouseover/onmouseout. I already know
I have a series of div's that I want to highlight with a blue
updated question I want to highlight weeks of the datepicker that have the sum
I have a PHP search script and I want to highlight the keywords that
I want to make a uiview that can be aware of highlight status, like
I have a javascript loop and want to highlight some numbers for(i=0;i<=100;i++){ $(#mydiv).append(<span>+i+</span>); }
I have a longer text and some keywords. I want to highlight these keywords
I want to use pygments with jekyll I have the following code: {% highlight
I have two tables and they highlight as expected, but I only want the
I want to remove the highlight that occurs when mouse over occurs on the

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.