We help IT Professionals succeed at work.
Get Started

Div Without Picture

DS928 asked
Last Modified: 2014-11-11
I have a div that opens when you click on a photo.  However I want a Div to open without a photo, just a white box.  What would I change to do this?


 jQuery.fn.center = function () {
        this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
        this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
        return this;
    $(document).ready(function() {
        $("#thumbnail img").click(function(e){
            $("#background").css({"opacity" : "0.7"})
            $("#large").html("<img src='"+$(this).parent().attr("href")+"' alt='"+$(this).attr("alt")+"' /><br/>"+$(this).attr("rel")+"")
            return false;
img {
    border: none;
#thumbnail img {
    cursor: pointer;
#large {
    display: none;
    position: absolute;
    background: #FFFFFF;
    padding: 5px;
    z-index: 10;
    min-height: 400px;
    min-width: 600px;
    color: #336699;
    display: none;
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    background: #000000;
    z-index: 1;
<div align="center">
   <div id="thumbnail">
     <h3>Click on the image</h3>
        <a href="images/addtocartpng.png"><img src="images/addtocartpng.png" width="124" height="100" rel="OK"/></a>
     <!--p id="large"></p-->
   <div id="large"></div>
<div id="background"></div>

Open in new window

Watch Question
Independent all-in web developer
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE