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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:07:44+00:00 2026-06-04T09:07:44+00:00

I have path that I then draw with Raphael JS . Code looks like

  • 0

I have path that I then draw with Raphael JS. Code looks like this:

var paper = Raphael($('#draw_here')[0], '32', '32');

var star = paper.path("M 22.137,19.625 32,12 20,12 16,0 12,12 0,12 9.875,19.594 6,32 16.016,24.32 26.008,32 z");

star.attr({
    fill: 'white',
    stroke: 'black',
    title: 'This is a STAAAAAAAR!'
});

It works and it draws 32 x 32 pixels big star. How to change it’s width and height?

I tried to do this:

var paper = Raphael($('#draw_here')[0], 64, 64);

var star = paper.path("M 22.137,19.625 32,12 20,12 16,0 12,12 0,12 9.875,19.594 6,32 16.016,24.32 26.008,32 z");

star.attr({
    fill: 'white',
    stroke: 'black',
    title: 'This is a STAAAAAAAR!',
    width: 64,
    height: 64
});

…but all that changes is “paper element’s“ width and height, not star’s.

The thing I want to do is put effect that star gets bigger when mouse’s cursor is on it.

Thanks in any advice!

P.S. I didn’t write the path myself, it’s get from Iconic set.

  • 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-04T09:07:46+00:00Added an answer on June 4, 2026 at 9:07 am

    You have to adjust the path too!
    Just try it on the Raphaël Playground.

    The width and height attributes are just the size of the element to draw on, but the path coordinates are still the same.

    For a simple resize you may also use

    star.transform("s2");
    

    to resize it to the 2x as before.

    If don’t want to edit the path and simple scale it, you should use the transform method to resize it and translate the full path by a certain value.

    star.transform("t32,32 s2");
    

    This for example will move the object by 32px from the top and 32px from the left and resize it to the 2x as before.

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

Sidebar

Related Questions

I have a mapping application that needs to draw a path, and then display
I have path like this...C:\restore\restoredb\ In that path i have files like this.. backup-2011-10-12T17-16-51.zip
I have for example .pdf file (path to that file). How to open this
I have a website that has a relative path to a stylesheet that looks
I have a line that I would like to add to a Path but
I have a path that I retrieve with the pwd command, I have to
I have a path + filename that contains [] several times. What i want
I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
In my live site I have php include() and require() that have full path
Using windows server, I have a path to a file that, when you click

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.