Skip to content

Commit

Permalink
Merge pull request #9 from vmarci21/v-1.1.1
Browse files Browse the repository at this point in the history
v-1.1.1
  • Loading branch information
vmarci21 committed Jan 6, 2016
2 parents ba3873a + b3b35d5 commit 19797df
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 23 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
javaScript and CSS responsive Photo / image viewer window and gallery.

## Demo
[JsFiddle](https://jsfiddle.net/xyxuxbpm/72/) ([Full page](https://jsfiddle.net/xyxuxbpm/72/show/)) or [CodePen](http://codepen.io/vmarci21/pen/MKJOyY) ([Full page](http://codepen.io/vmarci21/full/MKJOyY/)),
[JsFiddle](https://jsfiddle.net/xyxuxbpm/81/) ([Full page](https://jsfiddle.net/xyxuxbpm/81/show/)) or [CodePen](http://codepen.io/vmarci21/pen/MKJOyY) ([Full page](http://codepen.io/vmarci21/full/MKJOyY/)),

[While theme](https://jsfiddle.net/xyxuxbpm/73/show/)
[While theme (version 1.1)](https://jsfiddle.net/xyxuxbpm/73/show/)


## Using
Expand All @@ -23,6 +23,9 @@ javaScript and CSS responsive Photo / image viewer window and gallery.
* Use the showtext function, with this parameter:
* First parameter: Title
* Second parameter: Full text

### Options
* Edit option object in script

### example
```javascript
Expand Down
23 changes: 18 additions & 5 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
/*ImagepopUp JS
Version: 1.1
Version: 1.1.1
http://intomedia.hu
https://github.com/vmarci21/PhotoPopUp
*/
var imagepopup = {
option: {
imageloadingerror_title:'Loading errors',
imageloadingerror_text:'Failed to load the picture :(',
close_element:'x',
open_element: 'Open',
enabled_keyboard_control: true,
enabled_touch_control: true
},
firstimage: true,
imageherei: 0,
wherediv: 1,
Expand All @@ -12,6 +20,9 @@ hasnext: false,
hasprev: false,
opened: false,
showimage: function(url,text,gallery,ie) {
if(text==undefined){
text = '';
}
document.getElementById("imagepopup_fixer").style.display='none';
this.opened = true;
var nextimageurl = '';
Expand All @@ -20,8 +31,8 @@ var wherediv2 = 2;
if(ie==undefined || ie=='' || ie==null){ie=0;}
if(this.firstimage){
window.addEventListener("resize",function(){imagepopup.resizeimage();});
imagepopup.mobiledrag();
imagepopup.keyboard_view();
if(imagepopup.option.enabled_touch_control){imagepopup.mobiledrag();}
if(imagepopup.option.enabled_keyboard_control){imagepopup.keyboard_view();}
this.firstimage = false;
}
if(gallery!=undefined){
Expand Down Expand Up @@ -62,7 +73,7 @@ setTimeout(function(){ document.getElementById('imagepopup').className = 'active
var newImg = new Image;
newImg.onerror = function() {
document.getElementById('imagepopup_load').className = '';
imagepopup.showtext('Loading errors','Failed to load the picture :(');
imagepopup.showtext(imagepopup.option.imageloadingerror_title,imagepopup.option.imageloadingerror_text);
};

newImg.onload = function() {
Expand All @@ -72,7 +83,7 @@ newImg.onload = function() {
document.getElementById('imagepopup_image'+wherediv1).className = 'active';
document.getElementById('imagepopup_image'+wherediv1).innerHTML = '<img id="nagy_kep'+wherediv1+'" src="'+url+'">';
imagepopup.resizeimage();
document.getElementById('imagepopup_panel').innerHTML = '<a href="'+url+'" target="_blank">Link</a> <a href="javascript://" onclick="imagepopup.hideimage();" class="close">x</a>';
document.getElementById('imagepopup_panel').innerHTML = '<a href="'+url+'" target="_blank">'+imagepopup.option.open_element+'</a> <a href="javascript://" onclick="imagepopup.hideimage();" class="close">'+imagepopup.option.close_element+'</a>';
document.getElementById('imagepopup_text').innerHTML = text;
if(nextimageurl!=''){
var newImg2 = new Image;
Expand Down Expand Up @@ -129,6 +140,8 @@ document.getElementById('imagepopup').style.display = 'none';
document.getElementById('imagepopup_text').innerHTML = '';
document.getElementById('imagepopup_image1').innerHTML = '';
document.getElementById('imagepopup_image2').innerHTML = '';
document.getElementById('imagepopup_image1').className = '';
document.getElementById('imagepopup_image2').className = '';
document.getElementById('imagepopup_prev').className = '';
document.getElementById('imagepopup_next').className = '';
document.getElementById("imagepopup_fixer").style.display='block';
Expand Down
36 changes: 22 additions & 14 deletions script_min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*ImagePopUp CSS 1.1*/
/*ImagePopUp CSS 1.1.1*/
#imagepopup {
position: fixed;
top: 0;
Expand Down
Loading

0 comments on commit 19797df

Please sign in to comment.