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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:01:18+00:00 2026-06-09T16:01:18+00:00

I have an Raphael element with click event handler: var paper = Raphael(container, 770,

  • 0

I have an Raphael element with click event handler:

var paper = Raphael("container", 770, 160);
var c = paper.rect(10, 10, 50, 50);
c.click(function () {
    alert("triggering");
})

How I can manually fire this event? (c.click() don’t work)
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-06-09T16:01:20+00:00Added an answer on June 9, 2026 at 4:01 pm

    Although this question is already answered, I will post my solution which I found out by random.
    It’s possible with the Raphael internals:

    When you attach an event listener like element.click(func) then the element object holds an array with all events. In this array there’s an object which has a method f (strange naming convention) which triggers the event.

    So to sum it up you can call your event with knowing the order of your events, in your case there’s just the click event which is on index 0, you can call it like: c.events[0].f();

    A more generic solution would be a function like

    function triggerClick(element) {
        for(var i = 0, len = element.events.length; i < len; i++) {
            if (element.events[i].name == 'click') {
                element.events[i].f();
            }
        }
    }​
    

    But beware that if you had multiple click events all were triggered.

    Here’s a fiddle to demonstrate.

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

Sidebar

Related Questions

If I have append a click event handler function to my Raphael element like
I have a Raphael text element with both a mouseup and click event handler.
I have this code in Raphael: var myrect = paper.rect(10,10, 25,25); The rectangle appears.
I have javascript function (that uses Raphael) that on click select area. And I
I have javascript function (that uses Raphael) that on click select area. On double
I have to clear and redraw a raphael javascript main container. I've tried with
I want to add text to a element in raphael js, I have added
I've got a bunch of Raphael element objects on a canvas and have associated
I do have a Paper.path() in Raphael that is filled with a simple texture:
According to this question Raphael - event when mouse near element i create a

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.