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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:42:20+00:00 2026-05-27T14:42:20+00:00

My script is meant to find the link to a fullsize picture from a

  • 0

My script is meant to find the link to a fullsize picture from a thumbnail and open it up in a modal window. It works fine in Chrome but just follows the link and seems to ignore the script in firefox.

   $(".gallery-item").click(function(e) {
     e.preventDefault();
    //get var to hold ".galler-icon a" for this specific pic
    var imagelink = $(this).children().children().attr('href');
    $('#dialog').append('<img id="theImg" class="resize" src="' + imagelink + '" />');
    var caption = $(this).find(".gallery-caption ").text();
    $('#dialog').append('<p id="theCaption">' + caption + '</p>');
    //Get the screen height and width
    var maskHeight = $(document).height();
    var maskWidth = $(window).width();

    //Set height and width to mask to fill up the whole screen
    $('#mask').css({
        'width': maskWidth,
        'height': maskHeight
    });

    //transition effect     
    $('#mask').fadeIn(1000);
    $('#mask').fadeTo("slow", 0.8);

    //Get the window height and width
    var winH = $(window).height();
    var winW = $(window).width();
    //Set the popup window to center
    $("#dialog").css('top', winH / 2 - $("#dialog").height() / 2);
    $("#dialog").css('left', winW / 2 - $("#dialog").width() / 2);

    //transition effect
    $("#dialog").fadeIn(2000);
    //if close button is clicked
    $('.window .close').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();
        $('#mask, .window').hide();
        $('#theImg').remove();
        $('#theCaption').remove();
    });

    //if mask is clicked
    $('#mask').click(function() {
        $(this).hide();
        $('.window').hide();
        $('#theImg').remove();
        $('#theCaption').remove();
    });
    return false;
});

To summarize firefox ignores this script and follows the link. How can I fix this?

  • 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-27T14:42:20+00:00Added an answer on May 27, 2026 at 2:42 pm

    Do you have this .click() bind running within the document.ready handler? If not, that is likely the source of your problem.

    $(function () {
      $(".gallery-item").click(function(e) {
      e.preventDefault();
      // etc...
      });
    });
    

    edit

    Since that didn’t work, the next thought that occurs is that you should try changing your class name to something without the hyphen. That could be tripping up FF. Give it a shot.

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

Sidebar

Related Questions

when the preview link is clicked it is meant to change the video script
well i am currently writing a script that is meant to check the logs
I was wondering how to handle errors inside a script that is meant to
I want to run a python script from within another. By within I mean
here the file https://docs.google.com/spreadsheet/ccc?key=0AurtxTJwggIpdG9GaE1TOV9wMEw2UHhjZVJyUXVETUE you'll find on sheet Key , what is meant to
I have a script that seems to not work, it it meant to update
I have a simple php/mysql script that stores in mysql database id, link, and
I'm using mongoose in a script that is not meant to run continuously, and
Looked for this but cannot find a resolution. By extra output, I mean the
I need a script to find out what is the lowest available domain name

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.