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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:40:50+00:00 2026-05-31T18:40:50+00:00

This works in all other browsers and I have no idea what the problem

  • 0

This works in all other browsers and I have no idea what the problem is. I’m kind of in a hurry so I thought I’d ask you guys in case I missed anything obvious. I have a link you click on which initiate a popup, and in Firefox (and possibly opera) the page auto scrolls back to the top.

    $('[class*=popup-link]').click(function(e) {

    /* Prevent default actions */
    e.preventDefault();
    e.stopPropagation();

    /* Get the id (the number appended to the end of the classes) */
    var name = $(this).attr('class');
    var id = name[name.length - 1];

    /* Show the correct popup box, show the blackout and disable scrolling */
    $('#popup-box-'+id).show();
    $('#blackout').show();
    $("html,body").css("overflow","hidden");

});

I need both preventDefault and stopPropagation to stop some other stuff happening. Can you see any errors or a way to stop this auto scrolling to the top? Thanks!

Quick Edit:

I’m also running a function which centers the box using

$(window).scroll(centerBox);

I’m unsure if this would affect scrolling in some odd way in firefox. The contents of this function are just adding CSS, so I doubt they would have any effect on it.

Another Edit:

A link to try it out. Not working in Firefox for me.
http://inserthtml.com/demo/internal-popup/

  • 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-31T18:40:52+00:00Added an answer on May 31, 2026 at 6:40 pm

    first, i see nothing wrong in the script. it should be preventing the “top jump” even only with e.preventDefault(). try stripping it down to this. it should tell if this handler is causing it or not

    $('[class*=popup-link]').click(function(e) {
    
        e.preventDefault();   //prevent the click from jumping esp on hashes
        e.stopPropagation();  //prevent from any parent click handlers that didn't prevent the jump
    
        //no code here for now
    
        return false;         //the natural way to prevent the jump
    });
    

    if this code prevents the jump, then there is something in the rest of your code that causes it especially broken scripts. check the console for errors also

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

Sidebar

Related Questions

This code below works in all web browsers except IE: <input type="text" name="passwordLogin" value="Password"
Hello I currently have this code checking if a cookie exists, it works all
web page : http://sideradesign.com/eco-art/gallery/ This code works fine in all brwosers except IE8 (haven't
I'm trying to figure out why this works: >>> comments = Comment.objects.all() >>>[c.content_object for
Has anyone seen this: ?? No jgem command works at all?? Though jruby -S
Does this code work across all standard compliant C++ compilers (it works with g++)?
This code didn't works as expected. I want to select all the posts that
I see no reason why this shouldn't work in all browsers, here is my
I've stumbled into a tiny problem, which, for some reason, i have no idea
I have a webserver (IIS) with an SSL cert for *.mydomain.com This works perfectly

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.