Skip to content

Commit

Permalink
Merge pull request #1 from chalist/master
Browse files Browse the repository at this point in the history
Fix bug: If you have few items of a class, so this script add few parent...
  • Loading branch information
9bitStudios committed Dec 22, 2014
2 parents d30a122 + 3c83497 commit dbe1faf
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions js/jquery.slickhover.js
Expand Up @@ -47,14 +47,15 @@

appendHTML: function() {
if($(object).is('img')) {

if(settings.animateIn) {
var icon = '<span class="icon" style="position: absolute; left: -100%; top: 0; height: 100%; width: 100%; background:url('+settings.icon+') center center no-repeat"></span>';
$(object).wrap('<div class="slickhoverWrapper" style="position: relative; max-width:100%; overflow:hidden; display:inline-block; background:'+settings.color+';"></div>');
$(icon).insertBefore($(object));
if($(object).parent().hasClass('slickhoverWrapper') == false){
if(settings.animateIn) {
var icon = '<span class="icon" style="position: absolute; left: -100%; top: 0; height: 100%; width: 100%; background:url('+settings.icon+') center center no-repeat"></span>';
$(object).wrap('<div class="slickhoverWrapper" style="position: relative; max-width:100%; overflow:hidden; display:inline-block; background:'+settings.color+';"></div>');
$(icon).insertBefore($(object));
}
else
$(object).wrap('<div class="slickhoverWrapper" style="position: relative; max-width:100%; overflow:hidden; display:inline-block; background:url('+settings.icon+') center center no-repeat '+settings.color+';"></div>');
}
else
$(object).wrap('<div class="slickhoverWrapper" style="position: relative; max-width:100%; overflow:hidden; display:inline-block; background:url('+settings.icon+') center center no-repeat '+settings.color+';"></div>');
}
},

Expand Down

0 comments on commit dbe1faf

Please sign in to comment.