1

I followed some advice from others to rearrange the order of the JS code in order to make the caption and lb-close float to the top.

I also added a breakpoint for a more responsive image flow (esp as my images fill up the page upon opening)

Unfortunately for me, once I added the breakpoint, it broke the overall code. When I inspect the element, it appears that the div.lb-details area is now 0x51.

Image here for reference: Caption has a 0 width Below is the code I created to make the pop-up responsive using breakpoints:

@media only screen and (min-width: 1024px) and (max-width: 1600px)
.lb-dataContainer {
  margin: 0 auto;
  padding-top: 5px;
  *zoom: 1;
  width: 100%;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

Here is the .lb-details and .lb-caption areas so that you can see that this has not been altered.

.lb-data .lb-details {
  width: 85%;
  float: left;
  text-align: left;
  line-height: 1.1em;
}

.lb-data .lb-caption {
  font-size: 13px;
  font-weight: bold;
  line-height: 1em;
}

.lb-data .lb-caption a {
  color: #4ae;

In JS file, I only changed the prototype function line:

Where the original was:

var self = this;
    $('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo($('body'));

Changed to:

var self = this;
    $('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div></div>').appendTo($('body'));    

What could be causing this issue?

Clara Kuo
  • 19
  • 1
  • I don’t feel like carefully synchro-scrolling through two overly wide lines of code, trying to spot what you might have changed. Please introduce line breaks, and _describe_ what you changed and why. Also, please make it a [mcve]. – misorude Oct 10 '18 at 07:15

0 Answers0