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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:29:27+00:00 2026-06-10T00:29:27+00:00

hi i want to addClass after clicking the raphael generated object http://jsfiddle.net/v2Ykt/ i had

  • 0

hi i want to addClass after clicking the raphael generated object http://jsfiddle.net/v2Ykt/

i had try to this

$('#inter-mapka a').click(function(){
        $('#inter-mapka a').removeClass("active");
        $(this).addClass("active");
    });

but nothing is happening, how can i do that

RAPHAEL

// A1   
    paper.path("M9,163.334 L12,163.25 L18.5,157 L80.958,157 L80.958,192 L64.5,192 L9,177.084Z").attr({"fill":"#6e3315", "stroke-width": 0, "fill-opacity": 0, "stroke": "transparent", "title": "budynek A1"}).mouseover(
        function () {
                this.animate({"fill-opacity": .7}, 200);
            }).mouseout(function () {
                this.animate({"fill-opacity": .0}, 200);
        });

GENERATED HTML

<div id="inter-mapka">

    <a title="budynek A1"><path style="fill-opacity: 0;" fill="#6e3315" stroke="none" d="M9,163.334L12,163.25L18.5,157L80.958,157L80.958,192L64.5,192L9,177.084Z" stroke-width="0" fill-opacity="0"/></a>

...

</div>
  • 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-10T00:29:29+00:00Added an answer on June 10, 2026 at 12:29 am

    Sorry for the delay. I’ve had a play with this now and the only way I could get it to do what you wanted was entirely in Raphael – perhaps the DOM elements are ‘managed’ by Rapchael so the jQuery doesn’t ever really kick in properly

    EDIT I’ve refactored this to simplify http://jsfiddle.net/joevallender/v2Ykt/6/

    var paper = new Raphael(document.getElementById('inter-mapka'), 172, 276);
    
    var a1 = paper.path("M9,163.334 L12,163.25 L18.5,157 L80.958,157 L80.958,192 L64.5,192 L9,177.084Z").attr({"title": "budynek A1"});
    
    var a2 = paper.path("M3.875,141H38c0,0,7.75-3.875,10-8c0-4.5,0-18.5,0-18.5s0.375-5.625-11.125-5.625    s-30.719,0-30.719,0L6.125,110H5l-0.012,10.969L3.875,121V141z").attr({"title": "budynek A2"});
    
    var a3 = paper.path("M81.125,93.188h-30c0,0-7.125-1.938-9.25-7.438c0-5.625,0-18.875,0-18.875    S42.503,61.75,48.001,61c5.624,0,33.124,0,33.124,0V93.188z").attr({"title": "budynek A3"});    
    
    var a4 = paper.path("M5,39.875l7.875,6H40.75c0,0,8.375-0.25,7.25-7.5c0-7.25,0.104-19,0.104-19L44,10H5V39.875z").attr({"title": "budynek A4"});
    
    var a5 = paper.path("M80,10v30.375c0,0,1.125,5,6,5.5c4.875,0,28.75,0,28.75,0L118.875,40V10H80z").attr({"title": "budynek A5"});
    
    var all = [a1,a2,a3,a4,a5];
    
    for(var i = 0; i < all.length; i++) {
      all[i].attr({"fill":"#6e3315", "stroke-width": 0, "fill-opacity": 0, 'stroke': '#f00'});
      all[i].mouseover(
        function () {
          this.animate({"fill-opacity": .7}, 200);
        }).mouseout(function () {
          this.animate({"fill-opacity": .0}, 200);
        });
      all[i].click(function(){
        clearAll();
        this.attr({"stroke-width": 1});
      });
    }
    
    function clearAll(){
      for(var i = 0; i < all.length; i++) {
        all[i].attr({"stroke-width": 0});
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(#topNav + $(#breadCrumb2nd).text().replace( , )).addClass(current); This is a snippet from my code. I want
I have one div, id = upload_msg. I want to show this up after
When I generate this table it is generated after the rest of the code
First off please see my example in JSfidle: http://jsfiddle.net/WMxKk/1/ You can see when you
I have a button with text in it. When clicking this button it will
For the sanity of my users, I want a 'mouseover' event to run after
What I'm trying to accomplish: I want to add a DIV after an existing
I've 3 divs that i want to highlight (with a css class) one after
/* ========== Expand Left Menu ========== */ $('div.minimized').click(function() { $(this).removeClass(minimized); $(this).addClass(expanded); $('a.main_nav').removeClass(min); $('a.main_nav').addClass(exp); $('#left_menu_ul
How do I get this code to work correctly if I want (A.length ==

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.