GithubHelp home page GithubHelp logo

terrymun / fluidbox Goto Github PK

View Code? Open in Web Editor NEW
2.2K 2.2K 171.0 535 KB

Replicating and improving the lightbox module seen on Medium with fluid transitions.

Home Page: http://terrymun.github.io/Fluidbox/

License: Other

HTML 0.81% JavaScript 89.83% SCSS 9.36%
css javascript lightbox modal-box ui

fluidbox's People

Contributors

benwilhelm avatar christianhegedues avatar gaya avatar hybernaut avatar jchck avatar jeffpersonified avatar joshuapinter avatar kkirsche avatar m19c avatar marcofugaro avatar marcstoecker avatar maxee avatar mesoptier avatar ngotchac avatar nhaglind avatar terrymun avatar toddmoy avatar zorker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fluidbox's Issues

Maximum scale to image size

It seems that the scale of the bigger image never stops, even you have a bigger monitor than the biggest image provided on the website.

IMHO the fluidbox should only scale to a maximum of the image size.

Add CSS file to bower.json

Specifying the CSS file in the main option would make this package much easier to user with grunt-wiredep.

[enhancement] Make compatible with lazy loading of images

Right now, fluidbox is incompatible with lazy loading of images, because it requires that all images be loaded before it initializes. It would be great if the code were refactored/modified to allow for one off initialization of fluidbox (e.g., in a callback) so that it would work with lazy loading.

More detailed step by step instructions.

Hey

I am working on getting your Fluidbox to work in WordPress. (By placing the code in the head)
I have not yet been able to get it to work.
Could you give step by step detailed instructions on how to set up Fluidbox to get it to work correctly?
If you can also add some customization instructions along the way that would also be helpful.

White flickering in Safari

A white flicker occurs on image enlargement in Safari (OS X, v7.0.6 tested). A double flicker occurs when image goes from large -> normal size.

The initial flicker is fairly consistent, while the large -> normal flicker is inconsistent. Some images trigger it, some do not.

Can't get Fluidbox working ... :(

Hi Terry,

I don't know if this is the right place to ask what probably is a simple noob question, but I can't get Fluidbox working.

Into the head of the HTML I have:

<link type="text/css" href="<txp:site_url />css/fluidbox.min.css" media="all" rel="stylesheet" />

At the bottom of the HTML I have:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js"></script>
<script src="<txp:site_url />js/jquery.fluidbox.min.js"></script>

And the HTML is:

<a href="design/CIMG0919_sfw.jpg" title="" data-fluidbox><img src="design/CIMG0919_sfw.jpg" title="" alt=""></a>

I've put it on the server so you can look into the source > http://www.villaesma.es/txp (under construction) ... in Chrome 32 (Mac) it looks as intented (for now).

Joop

License

What's license is Fluidbox available under?

image in a fixed size div

when the img parent div is fixed size and set overflow: hidden, the image resized part will be hidden after zoom .
Any idea to deal with this case ?

White Flash

There's a white flash when closing the Fluidbox that flashes twice.
The first is while scaling down the image and the other is after the image is closed.
I think this happens when switching between the two image sizes but the effect is really ugly.

Next/previous navigation

Though you stated to keep this plugin simple, I think it's vital to have basic image navigation to make viewing a gallery of images more intuitive. Basic key navigation without any user interface would be fine, touch navigation (I prefer Hammer.js) would be a nice addition as well. Though phones might be too small, a tablet would benefit.

Would love to hear your thoughts and help you out 👍

Does not work when using lazy image loading plugin

Fluidbox fails to attach itself to anchors with more than one element in them. The lazy image loading plugin I use adds a noscript element in the anchor element below the image which is why Fluidbox skips it.

I'd suggest removing that 'feature' and in the case of multiple elements you pick the first img element. I might propose a pull-request later today.

Doesn't seem in bower

Is Fluidbox registered in bower's registry?

# e@theaquaMacbook in ~ [12:57:24]
➜ bower search Fluidbox
No results.

# e@theaquaMacbook in ~ [12:57:31]
➜ bower search fluidbox
No results.

Fast click cause big image not to be visible

If you click 3 times fast on an image (show big, close, show big), the animation seems not to finish correctly. So after the last click, the big image is not visible; opacity of the big image (the fluidbox generated div) is still on 0.

Stacking order of opened images

Sorry mate, I didn't mean to push you with my request yesterday.
Thing is, I checked your 1.2.4 and opened images now are kept behind other images, either thumbs or already loaded in some, to me, random manner. (Tested in Safari 7 and Chrome 33)
This also makes it undesirably possible to open several images at once.
This becomes most obvious in the galleries section or if you open an image that's not in your viewport center.

On another sight, something different: Safari 7 doesn't sharpen the image after zooming it, keeps it all blurred.

Sorry to make you fiddle around with this but that's my two observations from today.

People, contribute to this! It's a great plug-in!

Disable fluidbox on small devices

On a device with a small screen we likely want the text and image to fit the entire width of the screen and so we need to disable fluidbox.

For instance, if I have only 480px, I do not want my text and image to be constrained to be even less than that (it makes text harder to read), only to have to use fluidbox to display the image at full device width... i.e at 480px. So, it would be useful to have an option to disable fluidbox under a chosen breakpoint.

The article suggest that "You can disable the effect easily, by adding a conditional statement listening on screen resolution upon the firing of the resize event.""

  1. Would it be possible to post the code and instructions where to insert that code, or maybe create an alternative script?
  2. Could a future version include a config option to disable fluidbox on small devices?

using fluidbox with Bootstrap3 Carousel

Hello!

Thank you for an amazing plugin!

I am trying to use fluidbox with images inside the Bootstrap Carousel since the .carousel{} class has overflow:hidden; fluidbox is not working as it is supposed to, It obviously works when I remove the overflow property but the carousel breaks. You have mentioned this case in the plugin's readme as well.

so basically is there any way I could make fluidbox work inside bootstrap's carousel?

Thanks for your help,

Bootstrap grid system hinders centering and sizing

Hi,
Love the plugin – great job.

Trying to integrate Fluidbox into our website which uses Bootstrap v3 – the grid system seems to lock the overlay in place, stopping it from getting to its full dimensions and centering on the page.

As an example, if the smaller image version is in a 6 column grid (col-lg-6), and you click on it to open it to the overlay, the overlay white background works, but the image itself can't open larger than its container – so it opens up, centered, within the container, rather than being centered in the viewport.

Could you please advise?

Thanks,
Dan

[request] prev/next ?

As subject; especially in a gallery it would be nice+convenient to have a prev/next possibility (I understand that it would introduce all kinds of issues and not the original aim of the project).

Cannot dismiss overlay on Firefox

Hi,

I've developed a simple example gallery with placeholder images here:

http://jsfiddle.net/5GDe4/7/

The site works on the latest versions of Chrome and Internet Explorer. However, on Firefox 28, once you've opened one image and closed it again, it appears that the lightbox overlay (id: fluidbox-overlay) is retained, meaning you can never click on anything else afterwards. You just end up resizing that one image ad infinitum.

Can anyone suggest where I'm going wrong, or is this an issue with the plugin?

(I'm on Windows 7 64-bit btw.)

Problems when used in combination with bourbon/neat

Hi! Your project looks very promising, but have some problems with it, when I try to use it on images put in columns using the bourbon/neat grid.

  1. The div.fluidbox-ghost is always visible and causes a big gap in my layout in size of the smaller scaled image.
  2. When the image is clicked, the div.fluidbox-overlay is created but doesn't get the content.
  3. The bigger image is cropped!

So, I don't know where is the mistake is, sorry! If you need my code or any screenshots for better understanding the issue, let me know.

A translation glitch when the img element have border style apply to it.

To try it, apply border: 20px solid rgba(255,0,0,.2) to the <img> element, try it directly in devtools will do, you will see the closing animation glitch

I recorded a screenie, please wait for a while ,it is 3.5MB

glitch
https://cloud.githubusercontent.com/assets/1708463/3054784/c5820932-e1ba-11e3-9332-861fc18e06fd.gif

I simply fix it by

start from line 131

// Resize and position ghost element
$ghost.css({
  width: $img.width(),
  height: $img.height(),
  top: $img.offset().top - $wrap.offset().top + parseInt($img.css('borderTopWidth')), // it will be the computed value, em/% will become px
  left: $img.offset().left - $wrap.offset().left + parseInt($img.css('borderLeftWidth')),
});

Zoomed image stays blurred in MacBook

This works just fine in Windows, Linux, Ubuntu. The thumbnail is of 70x120, and the real image is 700x1200 (10x scale).

Any idea what might cause this? Is it the scale that's too big?

Preloader

Hi, i loved your library, just wanted to ask if there is a preloader option or is on the way, or i just not saw it.

Thanks!

Version description not up to date

The description of the plugin version reads 1.2.1 in all files/downloads. Should match the latest release.

Also there's still one white flash when opening and closing (OSX Safari 7.0.2 and Chrome 33). Is this intentional? Medium has a very smooth transition without flickering. Would totally use your plugin if it was that way.

Anyways, kudos for a nice lightbox, love the positioning.

Quick tip on how to implement the variables?

I've been changing the variables in source - having failed to effectively implement variable changes in the implementation. Any advise on how to control fluidbox variables in the "chain" implementation.

$(function () {
    $('a').fluidbox();

      viewportFill: 0.8    //example
})

thanks ian

Image pops after done loading

Summary: After clicking on a thumbnail, the larger image popups up. Once it's fully popped-up, it just (ever so slightly) changes in size, which makes the final result jump compared to the 'pre-final' one. The final image also seems to be more in focus ('sharper'?), don't know why.
On: Mac, latest version of Google Chrome
Page: http://terrymun.github.io/Fluidbox/

Click on the image of the church-like building, and look at the intersecting between the buildings really closely. After the image is done loading, the intersecting shrinks, appearing to 'bring the towers closer'. The image of the guy standing in front of the window seems to grow by a couple pixels after loading.

Firefox seems to have similar issues, but strangely enough only on the window picture, not on the church one. (Could be due to the additional toolbar I'm running on FF, which creates a different viewport).

Incorrect size and position

Hi,

I guess I am the first one coming with an issue :)

Not sure how to explain it but please have a look at this page:
http://france.totorotimes.com/dune-of-pilat/

Not sure what the problem is but for sure the plugin doesn't show the image in a very nice way. Do you know what's going on?

Thanks a lot, can't wait to see this nice plugin working.

Couple of issues

My site is not live yet, so I can't provide a link .. I think there is an issue with where the ghost image is in the layout tree.

When I click a link there are a couple of issues (possibly same thing).

  1. I see the image scale up, however the white div is in front of everything
  2. The larger image is hidden by parts of the parent div(s)

Prevent Upscaling

First: Thumbsup on the cool plugin. - I'm planning on using it because of its simplicity.

I'm no programmer myself, so I don't know how it could be achieved or how much work it would be, but I really think it would be a very useful feature, to allow the prevention of upscaling.

I plan to use the plugin for the display of web design work, meaning: If I have a site that's only about 1000px wide, i hardly can produce shots that are bigger than this and If visitors have really big viewports, those screens might get blown up above original size quite a bit which doesn't really look very nice anymore.

Let me know what you think

Cheers
Phil

linking to higher resolution image but different size

Hi,
first of all thanks for this great plugin.
I do have 2 questions please:
1- what is the browser compatibility for the plugin?
2- i would like to use it for a hight resolution image. Lets say the thumbnail in always 100x100px but the higher resolution image will not always have the same size and not necessary square. how can i achieve that?

Thanks

Previous / Next

Would it be bloating if there was an option to step through a collection of images (gallery) using classic prev / next buttons while you are in "focus" mode?

Then it would be the neatest gallery plugin ever!

Z-index setting sticks after lightbox is dismissed

It appears that when a lightbox is and dismissed, the high z-index setting sticks with the image, causing visual conflicts. The z-index should reset when the lightbox is dismissed and the image returns to normal size/position. This happens in all browsers.

Here's the full explanation and example:
I have a site that's in development that uses a top header with a z-index of 999, allowing it to stay above the content at all times, even when scrolling vertically in the browser. It conflicts occasionally with Fluidbox, so I've used the stackIndex configuration setting (and CSS) to modify the Fluidbox/header relationship in a couple different scenarios:

If I set Fluidbox above the header, the lightbox appears to work perfectly. The semi-transparent (default white) overlay is placed, and the image is "lightboxed". However, after closing the lightbox and scrolling through the content of that page, the now-non-lightboxed image moves over the top of the header.

If I set Fluidbox below the header, the problem above is fixed: non-lightboxed image moves under the header. However, now the semi-transparent overlay doesn't cover the header at all.

The first scenario (Fluidbox above the header) seems like the way Fluidbox should work, with a bug stemming from the post-lightbox image's z-index holding the same setting as that of a lightboxed image—thus keeping the non-lightboxed image above the header.

Here's a link to the development site in question (specific content with an image):
http://charlotter.wpengine.com/issue-1/hello-world/

To replicate this issue:
—Click the image and scroll down and see that the image should go over the header menu bar. All should be well.
—Then, click the image again and the lightbox is dismissed, returning the image to its rightful place.
—Scroll down and you'll see the image go over the header menu bar, even in its normal state.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.