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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:44:16+00:00 2026-06-07T19:44:16+00:00

I am using Raphael graphics and animations which is a javascript library. I want

  • 0

I am using Raphael graphics and animations which is a javascript library. I want the user to mouseover the blue square in the bottom row, middle column. When they mouseover I want the blue box to glow(Raphael function) black. I am trying to use this function on rec8, but I don’t think I’m doing it correctly. Can someone please correct my code or help me. Thanks. 🙂 Live Long and Prosper.

<html>
<head><title></title>
<script src="raphael-min.js"></script>
<script src="jquery-1.7.2.js"></script>

<style type="text/css"> 
#input
{
margin-top:-200px;

}
</style>

</head>

<body>

<div id="draw-here-raphael" style="height: 400px; width: 400px; background: #666; z-index:0;">
</div>

<div id="input" style="z-index:99;" >
  <input type="text" value="0"; style="text-align:right;" /><br />
</form> 
  </div>

<script type="text/javascript">
//all your javascript goes here
$(function() {
var r = new Raphael("draw-here-raphael"),

    // Store where the box is
    position = 'left',

    // Make our pink rectangle
    rec = r.rect(20, 20, 250, 300, 10).attr({"fill": "#fbb"});

    $("rect").mouseover(function(e) {
        $(this).attr({"fill": "red"});
        });
    $("rect").mouseout(function(e) {
        $(this).attr({"fill": "#fbb"});
    }); 
    //first column
    rec2 = r.rect(30, 80, 50, 40, 5).attr({"fill": "blue"});
    rec3 = r.rect(30, 130, 50, 40, 5).attr({"fill": "blue"});
    rec4 = r.rect(30, 180, 50, 40, 5).attr({"fill": "blue"});
    rec5 = r.rect(30, 240, 50, 40, 5).attr({"fill": "blue"});
    //second column
    rec6 = r.rect(90, 80, 50, 40, 5).attr({"fill": "blue"});
    rec2 = r.rect(90, 130, 50, 40, 5).attr({"fill": "blue"});
    rec7 = r.rect(90, 180, 50, 40, 5).attr({"fill": "blue"});
    rec8 = r.rect(90, 240, 50, 40, 5).attr({"fill": "blue"});
        $("rec8").mouseover(function(e) {
        $(this).glow({width:10});
        });
    $("rec8").mouseout(function(e) {
        $(this).glow({width:0});
    }); 
    //third column
    rec9 = r.rect(150, 80, 50, 40, 5).attr({"fill": "blue"});
    rec10 = r.rect(150, 130, 50, 40, 5).attr({"fill": "blue"});
    rec11 = r.rect(150, 180, 50, 40, 5).attr({"fill": "blue"});
    rec12 = r.rect(150, 240, 50, 40, 5).attr({"fill": "blue"});
});

</script>

</body>
</html>
  • 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-07T19:44:18+00:00Added an answer on June 7, 2026 at 7:44 pm

    This selector:

    $("rec8")
    

    Is a jQuery selector for any <rec8 /> tags. Those probably don’t exist. You should attach your mouse events to the returned raphael elements:

    rec8 = r.rect(90, 240, 50, 40, 5).attr({"fill": "blue"});
    rec8.mouseover(function(e) {
        this.glow({width:10});
        });
    rec8.mouseout(function(e) {
        this.glow({width:0});
    }); 
    

    but for some reason when I mouseout it doesn’t go away

    That’s because glow returns a new set that represents the glow, so you need to remove it. From the Raphael documentation:

    Note: Glow is not connected to the element. If you change element attributes it won’t adjust itself.

    You need to track the returned set that Raphael gives you as part of the glow, and remove it. Perhaps like this:

    var rec8 = r.rect(90, 240, 50, 40, 5).attr({"fill": "blue"});
    var rect8glow;
    rec8.mouseover(function(e) {
        rect8glow = this.glow({width:10});
        });
    rec8.mouseout(function(e) {
        rect8glow.remove();
    }); 
    

    You can see a working demo of that here.

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

Sidebar

Related Questions

I'm using the Raphaël—JavaScript Library to create some pie chart graphics, but I want
I am using Raphael's JavaScript library (http://raphaeljs.com/) to draw some graphics into my web-application.
I’m generating multiple, random sized, circular elements using the Raphael JavaScript library but because
I'm using the raphael javascript library, and I'd like to draw a straight line
I'm looking for javascript libraries that draw graphs using the Raphael library. Until now
I'm creating some circles using Raphael. When a user clicks a button, I want
I have a graphics page which shows SVG graphics. I am using Raphael graphics
I am simply trying to create some simple vector graphics using the Javascript Library
I am creating a module to graphically visualize workflows using raphael,which take data from
I'm trying to build a puzzle game in javascript, using raphael to take care

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.