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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:03:52+00:00 2026-06-02T22:03:52+00:00

I am writing a plugin to use to make a loading-like gif using Raphael

  • 0

I am writing a plugin to use to make a loading-like gif using Raphael js. The base of the code is modeled after this.

A demo of my plugin can be found on jsfiddle.

My problem is that I cannot seem to get the svg to be in the center of whatever jquery element is selected. My idea in that fiddle was to place the svg inside a div that is created and try to center that div but I can’t seem to get that to work either.

Any ideas?

EDIT:
I can get it centered by hacking the margin property of the containing div. Something like this works:

$loadingContainer = $('<div class="loading"></div>').css({margin: -(this.innerHeight()/2) + 'px auto'}).appendTo(this),

Notice the negative margin… But I am trying to avoid doing that and actually use Rahpael to position the loading-like “gif”

  • 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-02T22:03:55+00:00Added an answer on June 2, 2026 at 10:03 pm

    You need to find the position and dimensions of the element using

    • .offset()
    • .outerWidth()
    • .outerHeight()
    • the closest positioned element to the .loading element, with .offsetParent(), so you can adjust the positioning.

    and use those to position your .loading element (with position:absolute)

    demo at http://jsfiddle.net/gaby/Aaqaf/2/

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

Sidebar

Related Questions

I was writing a Blog like application Using Rails3/Mongoid, and now trying to use
I'm writing some plugin code in a dll that is called by a host
I'm writing my first rails plugin and could use a little help. In a
I'm developing Scala code using Eclipse, often when I run tests I get this
I want to make a firefox plugin using XUL for making GUI. And I
I'm writing a plugin that makes use of the wp_mail function. However I want
I am writing a plugin using the standard authoring pattern for jQuery, using methods
I'm writing a plugin for a framework that loads my code as a child
In a plugin I am writing I am using alias to override one of
I'm writing a plugin for another piece of sofware we use in my office

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.