1. DODAJTE SLIKO (.jpg, .bmp, .gif)
2. IZBERITE OKVIR
3. DODAJTE PASPARTU
4. BARVA PASPARTU-ja
* KLIKNI na puščico in ZAMENJAJ okvir
RAZMERJE 1:3 (š:v), primer 60x80cm
$(function (){ $(":file").change(function (){ if(this.files&&this.files[0]){ var fileToLoad=this.files[0]; if(fileToLoad.type.match("image.*")){ var reader=new FileReader(); reader.onload=imageIsLoaded; reader.readAsDataURL(this.files[0]); }else{ alert("Prosimo izberite sliko..."); }} }); });
function imageIsLoaded(e){ $('#myPictImage').attr('src', e.target.result); $('#myPictImage_vod').attr('src', e.target.result); }
var _URL=window.URL||window.webkitURL; var vodoravnaSlika=false;
$("#file").change(function(e){ var file, imga; if((file=this.files[0])){ imga=new Image(); imga.onload=function(){ var pic_real_width=this.width ; var pic_real_height=this.height; if(pic_real_width > pic_real_height){ $("#1").css("display","none"); $("#2").css("display","block"); vodoravnaSlika=true; }else{ $("#1").css("display","block"); $("#2").css("display","none"); vodoravnaSlika=false; }};
imga.onerror=function(){ alert("Prosimo izberite sliko... (.jpg, .gif, .bmp)"); }; imga.src=_URL.createObjectURL(file);
};
});
var myGlobalFrameImgIndex=0; var maxIndex=8; function changeImage(count){ var imgId='#myFrameImage'; if(vodoravnaSlika){ imgId='#myFrameImageVod'; } var imageName=$(imgId).attr('src'); var tmpImageName=imageName.substring(0, 8); var index=imageName.substring(8, 9);
if(count!=''){ if(count=='-1'){ myGlobalFrameImgIndex=parseInt(index) - 1; if(parseInt(myGlobalFrameImgIndex) < 0){ myGlobalFrameImgIndex=maxIndex; }}else{ if(parseInt(index) >=maxIndex){ myGlobalFrameImgIndex=0; }else{ myGlobalFrameImgIndex=parseInt(index) + 1 }} } var newImage=tmpImageName+myGlobalFrameImgIndex+'.jpg';
$(imgId).attr("src", newImage); }
$(document).ready(function(){
$("#paspartuId2").on('change',function(){ var myPictureSelector="#myPictImage"; var inside="inside_picture"; var ozek="inside_picture_with_paspartu_ozek"; var obicajen="inside_picture_with_paspartu_obicajen"; var sirok="inside_picture_with_paspartu_sirok"; if(vodoravnaSlika){ ozek="inside_picture_v_with_paspartu_ozek"; obicajen="inside_picture_v_with_paspartu_obicajen"; sirok="inside_picture_v_with_paspartu_sirok"; inside="inside_picture_v"; myPictureSelector="#myPictImage_vod"; }
var width=this.value; $(myPictureSelector).removeClass(); if(this.value!=''){ if(this.value=='20'){ $(myPictureSelector).addClass(ozek); }else if(this.value=='40'){ $(myPictureSelector).addClass(obicajen); }else{ $(myPictureSelector).addClass(sirok); }
}else{ $(myPictureSelector).addClass(inside); }
});
$("#paspartuId").on('change',function(){ var myPictureSelector="#myPictImage"; if(vodoravnaSlika){ myPictureSelector="#myPictImage_vod"; }
if(this.value!=''){ var color=this.value; $(myPictureSelector).css('background', color); }else{ $(myPictureSelector).addClass('inside_picture'); $(myPictureSelector).css('background', ""); }
});
});
