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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:04:09+00:00 2026-05-27T00:04:09+00:00

I work with a simple modal to understand how jQuery modal works. With this

  • 0

I work with a simple modal to understand how jQuery modal works. With this process

var load = 'alert.html'; // THE PURPOSE OF THIS QUESTION IS TO CHANGE "alert.html" to "image.jpg"
$(this).click(function(e) {
    e.preventDefault();
    $('body').append('<div id="overlay" />');
    $('#overlay').fadeIn(300, function() {
        $('body').append('<div id="alertModalOuter"><div id="alertModal"></div></div>');
        var outer = $('#alertModalOuter');
        var modal = $('#alertModal');
        var defWidth = outer.outerWidth();
        var defHeight = outer.outerHeight();
        modal.load(load + ' #alert', function() {
            var alertBoxContent = $('#alert');
            var alertWidth = alertBoxContent.outerWidth();
            var alertHeight = alertBoxContent.outerHeight();
            var widthCombine = -((defWidth + alertWidth) / 2);
            var heightCombine = -((defHeight + alertHeight) / 2);
            modal.animate({width: alertWidth, height: alertHeight}, 200);
            outer.animate({marginLeft: widthCombine, marginTop: heightCombine}, 200, function() {
                alertBoxContent.fadeIn(200, function() {
                });
            });
        });

This appends the content of an external file come (from load) to the modal windows; but this only works for the content within tag of id=”alert”. How can I remove the role of “alert” to display the entire content of external file. For example, I want to load an external image (which is an image file and not between “alert” tag).

  • 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-27T00:04:10+00:00Added an answer on May 27, 2026 at 12:04 am

    You don’t have to specify the #alert selector and it’ll load the whole page. It’s worth noting that if you don’t specify a selector, then load calls .html() and processes all the scripts before removing them. You may have some scripts running giving you unexpected results. The .load() docs

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

Sidebar

Related Questions

I really do not understand why this simple code works fine in the first
Why does this fail, it's supposed to be simple and work ? fisier.seekg(0, ios::end);
This is kind of a long way to go to ask a simple question,
I'm trying to understand how modal windows work. I know, there are multiple plug-ins
We use a simple object model for our low level networking code at work
I have a simple Poco-Model using abstract classes, and it seems not to work
I'm prepping for a simple work project and am trying to familiarize myself with
Is there a build-in way in C# to work with simple config files which
I'm trying for a week to make my XSP server work with simple static
I am writing a simple custom work item browser and I'd like it to

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.