GithubHelp home page GithubHelp logo

karacas / imgliquid Goto Github PK

View Code? Open in Web Editor NEW
972.0 972.0 207.0 494 KB

jQuery plugin to resize images to fit in a container.

Home Page: http://goo.gl/Wk8bU

License: MIT License

JavaScript 28.65% HTML 71.35%

imgliquid's People

Contributors

bryant1410 avatar gazenbeinas avatar iign avatar imcotton avatar karacas avatar kingyes avatar tiagoroldao 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imgliquid's Issues

flash effect on image refresh

Hi,

Im Using the Plugin for loading Images from webcam. The images will be refreshed every 2 seconds and there is a flash effect .
Is it possible to remove this effect ? perhaps is this the result of a timeout or fade effect ?

help me please.

Image Blowup in old process method

Images are blowing up (resizing larger incrementally forever) inside containers in infinite loop. This is caused by this check always returning true:

if ($imgBoxCont.sizeOld && $imgBoxCont.actualSize !== $imgBoxCont.sizeOld) makeOldProcess();

within the checkResponsive() function. An easy fix is to set responsive: false in init call. I've forked the project and I'll be looking into this right now.

Can you un-initialise imgLiquid?

Hey there,

I really only need to trigger imgLiquid at certain screen widths and remove it from others, is there any functionality to allow this?

Image URIs should not be encoded by default

I'd a problem with URIs containing encoded parameters (amazon S3 URIs).

The following code always encode the image URI:

                    // Check change img src
                    if ($imgBoxCont.css('background-image').indexOf(encodeURI($img.attr('src'))) === -1) {
                        // Change
                        $imgBoxCont.css({'background-image': 'url(' + encodeURI($img.attr('src')) + ')'});
                    }

To amend this I did a dirty fix:

          // Check if the URL is already encoded.
          var imgUrl = $img.attr('src').match('%') ? $img.attr('src') : encodeURI($img.attr('src'));

                    // Check change img src
                    if ($imgBoxCont.css('background-image').indexOf(imgUrl) === -1) {
                        // Change
                        $imgBoxCont.css({'background-image': 'url(' + imgUrl + ')'});
                    }

Unfortunately I'm too busy to work on a PR right now.

Big big images not working

I'm trying to load any image on my div( 219x172)...but when the image is really big like 2480x600...it doesn't work...and the result image is just a cropp of some part of the image... HELP !!

Resizing images that are loaded into bootstrap carousel

Thanks for the awesome resizer!
I am currently trying to resize images that are dynamically loaded into a bootstrap carousel.
By default the images are hidden with css display:none, so I think the plugin cannot read the width and height. I tried triggering it by attaching it to the carousel slide event, and that did seem to resize it, but it was not able to position it properly in the carousel window.

Any suggestion on how to approach this?

daniel

Multiple images inside imageliquid container causes a problem

I'm applying the plugin on a div which has other elements inside it (as a large photo background). When the child elements have images, they are hidden by the plugin. Please target all imageLiquid elements by class/id so it doesn't affect other elements within the selector's ranges.

(similar to the other issue regarding a:first)

Does not recognise class-based size

On FF at least.

I find I MUST use a style attribute to set the width and height of the containing block. A width or height set via a class on that block simply does not work - it leaves the block empty, devoid of any images at all.

This is quite a restriction, especially on systems where the size of the block will vary and is not fixed in the markup. Most responsive sites will be like this. The plugin needs to be able to read the calculated size of the block, and maybe even track changes to that size as the page is resized. Without that, it does not play well with modern web techniques and so should probably be avoided.

blurry image error on featured image box working under layers theme

we could not find out why this changes original image size to odd sizes and make it blurry. here are the links you can check it:

homepage featured image (blurry):
http://vettimes.makemedia-test.com/

same image on the post with original size:
http://vettimes.makemedia-test.com/news/success-for-cattitude-feline-focused-cpd-days/

original image size is 800px × 400px, but when we make the image featured the size becomes 246px 123px which looks randomly picked. we tried to to find the function how it picks that size but we couldnt.

does anyone can help please?

I can't change image

I try to change image for to make a slide show with jQuery attr() Method (http://www.w3schools.com/jquery/html_attr.asp):

Simple example:
sym.$("iGirona").attr('src', 'images/girona2.jpg');
or with array of images:
sym.$("iGirona").attr('src', 'images/'+aGirona[actGirona]);

But the image don't change. If I put comment or delete imgLiquid function lines then works correctly. Why can it be?

Thank you very much.

Note: dGirona is a div container with class imgLiquid and iGirona is inside as img.

Error on empty div breaks whole process

While using the plugin blindly on multiple divs (that may or may not have images (may contain embed in place of an image) an error occurs when applying on divs with no image inside (as supposed).
When the error callback is triggered, a "Uncaught TypeError: Cannot read property 'onItemError' of undefined" is raised.

Does not load in IE

I seem to have an issue with this plug-in. Whenever you try to refresh the page more than once, the images won't load and the animated gif will just be there, spinning away. This works for both the demo of yours and the code I've written on my website. There aren't any errors showing in the console, so I'm not sure what is causing it. Any ideas?

Untitled-1

Refresh Support?

Hello, i'm not sure if this is the right place to comment on this, but i was wondering if a method can be added for changing out an image. Meaning, when i dynamically swap out the image with a different one in my app, i'd like to be able to call a function on the container that refreshes the imgLiquid image. I hope that makes sense. Thanks in advance.

Different image sizes

Hi,

Im Using the plugin for diffrent images sizes loaded from Webcam.
I have one container and different cameras. on Camera select, a new image will be loaded and placed in the div (and refreshed every 2 seconds).

my problem is: for the first image is everything ok but if a select a new cam with a different ratio, the image will be stretched to fill the old image size and not the original...

calling the imgliquid() on every image Load is a possible solution but i become a flash effect (the image disappear and appear every 2 second)

please help me to fix this problem...

Not filling

Trying to get an image to fill a DIV on this site:

http://94country.wibwradio.com/

The large image of the cowboy.

I am calling:

jQuery(".imgLiquidFill").imgLiquid({ 
  fill: true, 
  horizontalAlign: "left", 
  verticalAlign: "top" });

with no luck.

This is my div:

<div id="home_slider" class="imgLiquidFill imgLiquid"><img id="slide" src="http://94country.wibwradio.com/wp-content/uploads/2013/07/94_rodeo.jpg"></div>

You need to grab the corner of the browser and dynamically resize it to see that it's not filling.

I am running the latest release of Firefox.

The red box in the upper-left corner shows the size of the DIV.

Accessibility issue: alt text is useless if image is display:none

Screen readers are able to trigger Javascript and read at least some css. When they come across things that are display:none, they skip over those elements.

So even though you put alt text on your images, since the image gets display:none the text wont be read by screen readers.

Image Exists

Hi, it´s possible to check if image exists?

I get imagem from a rss feed, from remote server, and some images do not exits in them, its possible to check if exists, e on error, not show blank image, change with another default image?

Url is encoded twice if already encoded

It seems whenever the plugin gets an url that is already encoded, it encodes it again, thus destroying the url.

Perhaps you can test if it is encoded before encoding it, e.g. with a regex, something like /%[0-9A-Z]{2}/g. (that regex needs testing).

Maybe you can do like this:

if (!new RegExp(/%[0-9A-Z]{2}/g).test($img.attr('src'))) {
    // Change
    $imgBoxCont.css({ 'background-image': 'url("' + encodeURI($img.attr('src')) + '")' });
} else {
    // Change
    $imgBoxCont.css({ 'background-image': 'url("' + $img.attr('src') + '")' });
}

First <a> is fullwidth

When Using ImgLiquid on a container which has an absolute position element with text and a button link. That button links gets "display: block; width: 100%; height: 100%;".

I have located the coolprit in the code:

$('a:first', $imgBoxCont).css({
'display': 'block',
'width': '100%',
'height': '100%'
});

And im wondering why this is being set?
Maybe add a option to disable this?

Not working with images names containing accents or other latin characters

Hi! and thanks for this awesome plugin, I love it. But as I can see, doesn't work with image file names containing accents or other characters, throwing 'image not found' errors. As I see in other opened issues, seems to be related with the image URI encoding that imgLiquid uses... any plans on fixing it? Thank you!

image does not appear

Hi,

Thanks for the Plugin :-)
I have a problem: im using the Plugin to show images from Webcam. The images will be loaded every second from the camera (by changing the src of the image with jquery) but they will not be showed...

can u help me please?

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.