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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:45:06+00:00 2026-05-22T21:45:06+00:00

i need to get multiple circle images when i click button. and i done

  • 0

i need to get multiple circle images when i click button. and i done that with a single image and that is drag-gable one also.

but i need multiple images as per user click the button.

Shall we do that with append function. I am using canvas tag in that. if so how can we implement that.

<script>

$(document).ready(function() {

  $('#pink-circle-button').click(function() {
    $('#currentCircle').show();

                   });
            });

    $(function() {
        $( "#currentCircle" ).draggable();
    });

    $(document).ready(function(){
    $("button#pink-circle-button").click(function(){
    $("p").append("<canvas id='currentCircle' class='drawCircle'/>");
  });
});
</script>

<style>
.drawCircle{border: 2px solid rgb(255, 0, 255);background-color:black; position: fixed; display: none; top: 97px; left: 572px; width: 153px; height: 150px; border-radius: 76.5px 76.5px 76.5px 76.5px;}
</style>


<canvas id="currentCircle" class='drawCircle'/></canvas>
  • 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-22T21:45:07+00:00Added an answer on May 22, 2026 at 9:45 pm

    I made something up that does not fulfill your needs as far as I can tell, but it might be a start: http://jsfiddle.net/eGjak/2/.

    var ctx = $('#cv').get(0).getContext('2d');
    
    $('body').bind('selectstart', function() {return false});
    
    var Circle = function() {
        this.x = Math.random() * 400;
        this.y = Math.random() * 400;
        this.c = 'rgb(' + Math.floor(Math.random() * 256) + ',' +
                     Math.floor(Math.random() * 256) + ',' +
                     Math.floor(Math.random() * 256) + ')';
    };
    
    var circles = [];
    
    function d(xp, yp, x, y) {
        return Math.sqrt((x-xp)*(x-xp) + (y-yp)*(y-yp));
    }
    
    $('button').click(function() {
        circles.push(new Circle);
        render();
    });
    
    var currindex = -1;
    
    $('#cv').mousedown(function(e) {
        bx = e.offsetX, by = e.offsetY;
        for(var i = 0; i < circles.length; i++) {
            if(d(circles[i].x, circles[i].y, e.offsetX, e.offsetY) < 50) {
                currindex = i;
                tx = circles[i].x;
                ty = circles[i].y;
            }
        }
    });
    
    var bx = 0, by = 0, tx = 0, ty = 0;
    
    $('#cv').mouseup(function(e) {
        currindex = -1;
    });
    
    $('#cv').mousemove(function(e) {
        if(currindex > -1) {
            circles[currindex].x = tx + (e.offsetX - bx);
            circles[currindex].y = ty + (e.offsetY - by);
        }
        render();
    });
    
    function render() {
        ctx.clearRect(0, 0, 400, 400);
        for(var i = 0; i < circles.length; i++) {
            ctx.beginPath();
            ctx.arc(circles[i].x, circles[i].y, 50, 0, Math.PI*2);
            ctx.fillStyle = circles[i].c;
            ctx.fill();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that need to get multiple cstrings. I current get one
My situation is that I need to get a single value that defines the
I need to get multiple posts in wordpress by ID. get_posts('p=34,36'); I assumed that
I need to get some information that is contained in the MFT on a
I'm trying to parse a single string and get multiple chunks of data out
I need to get the last element of a split array with multiple separators.
I have multiple forms on the page and i need to get the values
so I have multiple HTML files which I need to get some praticular data
I need to get multiple variables up into my JS code from my C#
Greetings, Here is my problem. I need to get data from multiple rows and

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.