kombai / freewall

Freewall is a cross-browser and responsive jQuery plugin to help you create grid, image and masonry layouts for desktop, mobile, and tablet...
MIT License
1.85k stars 375 forks source link

Freewall Image Layout + Fancybox Plugin: Problem #34

Closed estebandinamarca closed 10 years ago

estebandinamarca commented 10 years ago

I am using Freewall and Fancybox to display images as a gallery popup. Specifically on the "image-layout.html", (Line 30), I can not use a dynamic "href" element for a link.

Example:

var temp = "<a href='here dynamic url' class='cell' style='width:{width}px; height: {height}px; background-image: url(galerias/galeria1/{index}.jpg)'></a>";

How I can solve this?

Thanks!

kombai commented 10 years ago

you can try with css:

a.cell {
 display:block;
 float: left;
}
estebandinamarca commented 10 years ago

I am repeating the route: galerias/galeria1/{index}.jpg

Here: var temp = "<a href='galerias/galeria1/{index}.jpg' class='cell' style='width:{width}px; height: {height}px; background-image: url(galerias/galeria1/{index}.jpg)'></a>";

and this is the results: 1

The "background-image" is not working.

kombai commented 10 years ago

Because this (line 34):

.replace("{index}", i + 1);

you can try:

.replace(/\{index\}/gi, i + i);
estebandinamarca commented 10 years ago

It works!

Many Thanks from Chile!

2

kombai commented 10 years ago

You are welcome!