invoice.js
1.64 KB
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
var invoice = new Class({
initialize : function(){
this.families = [];
this.images = [];
this.load_image = null;
this.invoice_rel();
this.onloadImages();
if(this.families[0])this.view_pic(this.families[0]);
},
invoice_rel : function(){
$$('a').each(function(a){
if(a.rel && a.rel.test(/^invoice_button/i)){this.families.push(a);this.images.push(a.href);}
},this);
},
onloadImages : function(){
this.families.each(function(a){
$(a).addEvent('click',function(e){new Event(e).stop();this.view_pic(a);}.bindWithEvent(this));
},this);
},
view_pic : function(a){
new Asset.images(this.images, {
onComplete: function(){
this.families.each(function(famil){$(famil).style.border = "4px solid #D7D7D7";$(famil).style.display = "block";});
$('invoice_pic').erase('html');
$(a).style.border = "4px solid #ab3d4a";
$(a).style.display = "block";
var img = new Element("img");
img.setProperty('src', a.href);
img.setProperty('width', 390);
img.style.border = "4px solid #D7D7D7";
img.setProperty('id', 'invoice_img');
$('invoice_pic').appendChild(img);
$('invoice_img').setStyles({'opacity':0});
var myEffect = new Fx.Morph('invoice_img', {duration: 'long'});
myEffect.start({'opacity':3});
//var array_title = a.title.split("|");
//$('invoice_articl').innerHTML=array_title[0];
//$('invoice_cine').innerHTML=(array_title[1]) ? 'Öåíà: <span class="ciner_red">'+array_title[1]+'</span>' : "";
//$('invoice_size').innerHTML=(array_title[2]) ? 'Ðàçìåð ðóëîíà: <span class="ciner_red">'+array_title[2]+'</span>' : "";
}.bindWithEvent(this)
});
}
});
window.addEvent('domready', function(){
invoice = new invoice();
});