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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:45:48+00:00 2026-05-30T01:45:48+00:00

I’m using the popular image selection jquery plugin imgAreaSelect – http://odyniec.net/projects/imgareaselect The page could

  • 0

I’m using the popular image selection jquery plugin imgAreaSelect – http://odyniec.net/projects/imgareaselect

The page could have any number of images so I have assigned a class to the image to enable the code on all of them.

$('img.select').imgAreaSelect({
...
});

The problem is once a selection has been made on any 1 of the images I want to prevent another selection being made on the remaining images on the page. Essentially I am looking to disable the plugin for all images apart from the one I have selected.

I will also want to be able to edit the selection again at some point using the coords which i’ve saved, so this is where the instance api comes in – http://odyniec.net/projects/imgareaselect/usage.html#api-methods

I’ll therefore be looking at doing something along the lines of

var select1 = $('img.select1').imgAreaSelect({
...
});

var select2 = $('img.select2').imgAreaSelect({
...
});

etc

The problem is a don’t have a defined number of images. Could i used something like $('img.select').each()? Still doesn’t help with appending a number to it though. I figure setting up the api instance part will help towards fixing my first issue.

My question is, how can I dynamically create an imgAreaSelect instance for each img on the page with a class of select (and probably with a number appended to it (which i’ve stored in the name attr)) and when an image is selected disable all other instances on the page? Thanks!

  • 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-05-30T01:45:49+00:00Added an answer on May 30, 2026 at 1:45 am

    Ok so i’ve used .each() to go through each image and add the instance of imgAreaSelect into an array. From there i can make calls to whichever image i need.

    var images = {};
    var i = 1;
    $('img.select').each(function (){
       images[i] = $('img.select.' + i).imgAreaSelect({
       ...
       });
       i++;
    });
    

    It may not be the best or most efficient way…looks pretty tidy to me though. Still open to suggestions.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.