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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:22:07+00:00 2026-05-23T10:22:07+00:00

I’ve written some jQuery code to display a box with data in the corner

  • 0

I’ve written some jQuery code to display a box with data in the corner of the users’ web browser. I’m using the .scroll event to make the box stay in the corner as the user scrolls up and down the page. Let me emphasize that I am not using jquery-ui dialog.

The only problem is that the box flickers as the page scrolls. I’m afraid that there will be no cross-browser solution to this problem as the different browsers seem to behave differently with scrolling. Barring a cross-browser solution, an IE solution would be nice (My web application is designed to be used by a specific group of about 100 users in my organization.)

Here are snippets of the relative code:

ExternalScroll: function () {
            LittleBlackBook.setPosition();
        }

    setPosition: function () {
        var scrollPosition = $(self).scrollTop();
        var cssTop = LittleBlackBookStatic.determineCssTop(this.height, this.isTop, this.vOffset, scrollPosition);
        var cssHeight = LittleBlackBookStatic.determineCssHeight(this.height);
        var cssLeft = LittleBlackBookStatic.determineCssLeft(this.width, this.isLeft, this.hOffset);
        var cssWidth = LittleBlackBookStatic.determineCssWidth(this.width);
        this.jQueryObj.css('top', cssTop);
        this.jQueryObj.css('height', cssHeight);
        this.jQueryObj.css('left', cssLeft);
        this.jQueryObj.css('width', cssWidth);
    }

var LittleBlackBookStatic = {
    determineCssTop: function (height, isTop, vOffset, vScroll) {
        var windowHeight = $(self).height();
        var scrollPosition = $(self).scrollTop();
        var newModalTop = isTop ? vOffset + vScroll : windowHeight - height + vScroll - vOffset;
        return newModalTop + 'px';
    },

    determineCssHeight: function (height) {
        return height + 'px';
    },

    determineCssLeft: function (width, isLeft, hOffset) {
        var windowWidth = $(self).width();
        var newModalLeft = isLeft ? hOffset : windowWidth - width - hOffset;
        return newModalLeft + 'px';
    },

    determineCssWidth: function (width) {
        return width + 'px';
    }
} // end LittleBlackBookStatic

I’m using jQuery to look up the scroll position as the page scrolls and change the CSS.

Is there a better way; a way that will make it scroll without flickering? If no, then why not?

  • 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-05-23T10:22:07+00:00Added an answer on May 23, 2026 at 10:22 am

    You should use fixed positioning for that box instead instead of animating it to keep it in the corner.

    You’ll use less javascript and avoid flickering that comes with animation.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.