forked from magnet0/mosaiqy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mosaiqy-nozoom.php
153 lines (104 loc) · 3.97 KB
/
mosaiqy-nozoom.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php require "includes/header.php" ?>
<!--
Javascript is on bottom of the page.
-->
</head>
<body>
<?php require "includes/title.php" ?>
<div class="loading mosaiqy">
<ul></ul>
</div>
<!-- Javascript is here below -->
<?php
$rows = 4;
$cols = 3;
if (isset($_POST['gridsize'])) {
list($rows, $cols) = explode("x", $_POST['gridsize']);
}
require "includes/lib.php"?>
<div>
<figure><a href="images/zoom/${img}"><img src="images/thumb/${img}">
<figcaption>${desc}</figcaption></a>
</figure>
</div>
</script>
<script>
$(document).ready(function() {
$('.mosaiqy').mosaiqy({
template : "mosaiqy_tpl",
rows : <?php echo $rows ?>,
cols : <?php echo $cols ?>,
avoidDuplicates : true,
animationDelay : 1000,
animationSpeed : 1200,
loop : true,
loadTimeout : 5000,
openZoom : false,
scrollZoom : false,
<?php
require "includes/json.php";
?>
});
});
</script>
<!-- this is not needed for plugin but if you need a simple page scroller... -->
<script>
$(document).ready(function() {
var page = ($.browser.opera)? $("html") : $("html,body"),
pagescroll = function(evt) {
var elementID = $(this).attr('href'),
elementOffset = $(elementID).offset().top;
pageOffset = (document.body.scrollTop !== 0)
? document.body.scrollTop
: document.documentElement.scrollTop;
var pageScroll = Math.abs(pageOffset - elementOffset),
timeScroll = (pageScroll < 2000)
? pageScroll * 1.25
: 2500;
if (pageScroll) {
page.animate({ scrollTop: elementOffset }, timeScroll, function() {
location.href = elementID;
});
}
evt.preventDefault();
};
$('nav a').bind('click', pagescroll);
$('section > a').bind('click', pagescroll);
$('#choosecurr li').bind('click', function() {
var $this = $(this);
$('li.current').removeClass('current');
$this.addClass('current');
$('#paypal_currency').val($this.find('span').data('currency'));
$('#currency_sign').html($this.find('span').html());
})
$('#chooseamount input')
.bind('blur', function() {
var $this = $(this),
val = parseFloat($this.val());
$this.val((isNaN(val) || (val < 1))? '1.00' : val.toFixed(2));
})
.bind('keydown', function(e) {
var $this = $(this),
val = $this.val(),
editingKeys = {
'8' : 'delete',
'9' : 'tab',
'46' : 'canc',
'37' : 'leftarrow',
'39' : 'rightarrow',
'190' : 'dot1'
},
key = e.which || e.keycode,
keynum = (key > 47) && (key < 58),
keypad = (key > 95) && (key < 106);
if (key == 190) {
return (0 > val.indexOf('.'))
}
if (!keynum && !keypad) {
return (key in editingKeys);
}
});
})
</script>
</body>
</html>