Skip to content

Commit

Permalink
random effect part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Syl committed Dec 5, 2013
1 parent 313c8c2 commit fa5b426
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
30 changes: 15 additions & 15 deletions dist/js/jquery.desoslide.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,6 @@
*/
app.loadImages();

/**
* Handling transition effect
*/
app.effectHandler();

/**
* Adding wraper
*/
Expand Down Expand Up @@ -238,7 +233,13 @@
* Function that handles the effect
*/
effectHandler: function() {
if(p.effect !== 'random') {
if(p.effect === 'random') {
/**
* Get a random effect
*/
current_effect = app.getRandomEffect();
console.log($(p.main.container).selector +': '+ current_effect);
} else {
/**
* Incorrect effect value
*/
Expand All @@ -252,13 +253,7 @@
} else {
current_effect = p.effect;
}
} else {
/**
* Get a random effect
*/
current_effect = app.getRandomEffect();
}
console.log(current_effect);
},

/**
Expand All @@ -267,7 +262,7 @@
getRandomEffect: function() {
var result, count = 0;

for(var prop in effects) {
for(var prop in app.effects) {
if(Math.random() < 1 / ++count) {
result = prop;
}
Expand Down Expand Up @@ -385,7 +380,7 @@
/**
* Data
*/
var src = $thumbs.find('a').eq(img_to_show).attr('href');
var src = $thumbs.find('a').eq(img_to_show).attr('href');
alt = $thumbs.find('img').eq(img_to_show).attr('alt');
caption = $thumbs.find('img').eq(img_to_show).data('desoslide-caption');
href = $thumbs.find('img').eq(img_to_show).data('desoslide-href');
Expand All @@ -395,6 +390,11 @@
*/
app.checkData();

/**
* Handling transition effect
*/
app.effectHandler();

$(p.main.container).find('img').attr({
'src': src,
'alt': alt,
Expand All @@ -412,7 +412,7 @@
* Adding overlay
*/
app.addOverlay();
});
});

/**
* Starting the loop
Expand Down
8 changes: 1 addition & 7 deletions dist/js/jquery.desoslide.min.js

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

0 comments on commit fa5b426

Please sign in to comment.