Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#251 Fotorama’s dimensions are the dimensions of the first image (by …
…order, not by loading time)
- Loading branch information
1 parent
0beb133
commit 23f1c0f
Showing
6 changed files
with
86 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Basic fotorama</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width"> | ||
|
||
<!-- jQuery, --> | ||
<script src="jquery/jquery-1.10.1.min.js"></script> | ||
|
||
<!-- Fotorama --> | ||
<link href="../out/fotorama.css" rel="stylesheet"> | ||
<script src="../out/fotorama.js"></script> | ||
|
||
<script type="text/javascript"> | ||
console = window.console || {}; | ||
console.time = console.time || $.noop; | ||
console.timeEnd = console.timeEnd || $.noop; | ||
|
||
$(function () { | ||
f = $('.fotorama').data('fotorama'); | ||
}) | ||
</script> | ||
</head> | ||
|
||
<body> | ||
|
||
<!--<p>Basic fotorama:<p> | ||
<pre style="margin-top: -1em; margin-left: 1em;"><code><div <mark>class="fotorama"</mark>></code></pre>--> | ||
|
||
<!-- Fotorama --> | ||
<div class="fotorama"> | ||
<a href="i/okonechnikov/1.jpg"></a> | ||
<a href="i/nyc/thumbs/crazyjohn.jpg"></a> | ||
</div> | ||
|
||
<!-- © --> | ||
<p>Photos <a href="http://okonet.ru/">by Andrey Okonetchnikov</a></p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
document.write( | ||
'<div class="fotorama" id="fotorama">' + | ||
'<a href="http://s.fotorama.io/okonechnikov/1.jpg"></a>' + | ||
'<a href="http://s.fotorama.io/okonechnikov/2-thumb.jpg"></a>' + | ||
'</div>' | ||
); | ||
|
||
describe('Dimensions', function () { | ||
var $fotorama, fotorama; | ||
|
||
beforeEach(function () { | ||
$fotorama = $fotorama || $('#fotorama'); | ||
fotorama = fotorama || $fotorama.data('fotorama'); | ||
}); | ||
|
||
it('fotorama’s dimensions are the dimensions of the first image (works only if script able to connect to the Internet)', function (done) { | ||
var $body = $('body'), | ||
$stage = $('.fotorama__stage', $fotorama); | ||
|
||
waitsFor(function () { | ||
return $stage.height() > 0 | ||
}, function () { | ||
expect($stage.height()).toBeGreaterThan(0); | ||
expect($stage.width()).toEqual($body.width()); | ||
expect($stage.height()).toEqual(Math.round($body.width()/(700/467))); | ||
|
||
done(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters