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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:06:44+00:00 2026-06-15T04:06:44+00:00

Below is my code. I am attempting to load a picture in a modal.

  • 0

Below is my code. I am attempting to load a picture in a modal. The picture exists on the page and I am able to get the source. Is there a way to simply load the image into a modal on click as I am trying to do here? I am able to click on an image and ALERT out the source; but when I try to plug the source into the function; nothing happens.

I am using ZEND but I do not believe that is relevant to the situation at hand and so I did not tag the question with the ZEND tag.

Can anyone explain what I need to do in order to load my image in a MODAL on click?

<?php
    $this->headLink()->appendStylesheet($this->baseUrl('css/default/index/designbox.css'));
    $this->jQuery()->onLoadCapturestart();
?>
<!-- Modal Done Here -->
$('.boxDES').click(function() {
    pic1 = document.getElementById(this.id).getAttribute('src');
    alert(pic1);

    $(pic1).dialog(
        {
            modal:      true,
            draggable:  false,
            title:      'Designs',
            height:     'auto',
            width:      'auto',
            open:       function(){
                            jQuery('.ui-widget-overlay').bind('click',function(){
                                jQuery(pic).dialog('close');
                            })
                        }
        }
    );
});
<?php $this->jQuery()->onLoadCaptureEnd(); ?>
<div id="designGroup">

    <div id="title">
        <?php echo strtoupper($this->object->GetType()); ?>
    </div>

    <div id="boxText">
        <?php echo $this->object->GetDescription(); ?>
    </div>

    <?php $links = $this->object->GetLinks(); ?>
    <div id="pictureBox">
        <ul id="grid">
            <li>
                <a href="#">
                    <img id="<?php echo $links[0];?>" class="boxDES" src="<?php echo '/images/design/thumbs/' . $links[0]; ?>"></a>
            </li>
            <li>
                <a href="#">
                    <img id="<?php echo $links[1];?>" class="boxDES" src="<?php echo '/images/design/thumbs/' . $links[1]; ?>"></a>
            </li>
            <li>
                <a href="#">
                    <img id="<?php echo $links[2];?>" class="boxDES" src="<?php echo '/images/design/thumbs/' . $links[2]; ?>"></a>
            </li>
            <li>
                <a href="#">
                    <img id="<?php echo $links[3];?>" class="boxDES" src="<?php echo '/images/design/thumbs/' . $links[3]; ?>"></a>
            </li>
        </ul>
    </div>
    <div style="clear: both;"> </div>
</div>
  • 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-15T04:06:45+00:00Added an answer on June 15, 2026 at 4:06 am
     This is how to build a variable that holds my IMG.
    
    var catIMG = $('<img/>', {
                                    "class" :"inline",
                                    src:pic1
                            });
    

    The below is the now fixed and complete JSCRIPT –

    $('.boxDES').click(function() {
        pic1 = document.getElementById(this.id).getAttribute('src');
        var catIMG = $('<img/>', {
                            "class" :"inline",
                            src:pic1
                    });
    
        $(catIMG).dialog(
            {
                modal:      true,
                draggable:  false,
                title:      'Designs',
                height:     'auto',
                width:      'auto',
                open:       function(){
                                jQuery('.ui-widget-overlay').bind('click',function(){
                                    jQuery(pic).dialog('close');
                                })
                            }
            }
        );
    });
    

    I was able to find this information here https://stackoverflow.com/a/10788966/1583066

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

Sidebar

Related Questions

I have the below code. I am attempting to 1. import an image from
Using the code below, I am attempting to fill a Canvas with UIElements and
I commented my code below to reflect what I am attempting to do here.
I'm attempting to convert a string to a TStream. My code below gives me
Please see below my code. I am attempting to bind an array of paramenters
I am attempting something along the line of below mentioned code. Though it works
I am attempting to run the code below but am getting multiple methods error
below is what I'm attempting to use for my site, this php page shows
I'm attempting to execute some sql using the mysql-flask python extension. The below code
I have the below code and I'm attempting to print out only the first

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.