Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions js/imgLiquid.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ imgLiquid.injectCss = '.imgLiquid img {visibility:hidden}';
function processBgSize() {

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

$imgBoxCont.css({
Expand Down
Binary file added tests/"woody".jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions tests/imgLiquid_escape.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>imgLiquid Jquery Plugin</title>

<!-- RESET ______________________ -->
<link href="reset.css" type="text/css" rel="stylesheet" />

<!-- JQUERY ______________________ -->
<!--[if lt IE 9]> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script> <![endif]-->
<!--[if gte IE 9]><!--> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js" type="text/javascript"></script> <!--<![endif]-->


<!-- IMGLIQUID ______________________ -->
<script src ="../js/imgLiquid.js" type="text/javascript"></script>


<!-- EXAMPLE ______________________ -->
<script type="text/javascript">
$(document).ready(function () {
$(".imgLiquidFill").imgLiquid({fill:true});
});
</script>

</head>


<body>
<div class="boxSep" >
<div class="imgLiquidFill imgLiquid" style="width:300px; height:300px; background-color:#000" >
<img alt="TEST" src='"woody".jpg' />
</div>
</div>

<div class="boxSep" >
<div class="imgLiquidFill imgLiquid" style="width:300px; height:300px; background-color:#000" >
<img alt="TEST" src="%22woody%22.jpg"/>
</div>
</div>
</body>


</html>