Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #18 does not work with jquery3 #19

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/imagelightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
{
image = $( '<img ' + options.selector + ' />' )
.attr( 'src', target.attr( 'href' ) )
.load( function()
.on('load', function()
{
image.appendTo( 'body' );
setImage();
Expand Down Expand Up @@ -169,7 +169,7 @@
{
var nextTarget = targets.eq( targets.index( target ) + 1 );
if( !nextTarget.length ) nextTarget = targets.eq( 0 );
$( '<img />' ).attr( 'src', nextTarget.attr( 'href' ) ).load();
$( '<img />' ).attr( 'src', nextTarget.attr( 'href' ) ).on('load', );
}
})
.error( function()
Expand Down Expand Up @@ -217,7 +217,7 @@
{
target = targets.eq( targets.index( target ) - ( swipeDiff < 0 ? 1 : -1 ) );
if( !target.length ) target = targets.eq( swipeDiff < 0 ? targets.length : 0 );
loadImage( swipeDiff > 0 ? 'right' : 'left' );
loadImage( swipeDiff > 0 ? 'right' : 'left' );
}
else
{
Expand Down Expand Up @@ -310,4 +310,4 @@

return this;
};
})( jQuery, window, document );
})( jQuery, window, document );
74 changes: 37 additions & 37 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,47 @@
/*
/* Main JS
/*
-----------------------------------------------------------------------------------*/
-----------------------------------------------------------------------------------*/

(function($) {

/*---------------------------------------------------- */
/* Preloader
------------------------------------------------------ */
$(window).load(function() {
------------------------------------------------------ */
$(window).on('load', function() {

// will first fade out the loading animation
$("#status").fadeOut("slow");

// will first fade out the loading animation
$("#status").fadeOut("slow");
// will fade out the whole DIV that covers the website.
$("#preloader").delay(500).fadeOut("slow").remove();

// will fade out the whole DIV that covers the website.
$("#preloader").delay(500).fadeOut("slow").remove();

$('.js #hero .hero-image img').addClass("animated fadeInUpBig");
$('.js #hero .buttons a.trial').addClass("animated shake");
$('.js #hero .hero-image img').addClass("animated fadeInUpBig");
$('.js #hero .buttons a.trial').addClass("animated shake");

})
})


/*---------------------------------------------------- */
/* Mobile Menu
------------------------------------------------------ */
var toggle_button = $("<a>", {
id: "toggle-btn",
------------------------------------------------------ */
var toggle_button = $("<a>", {
id: "toggle-btn",
html : "Menu",
title: "Menu",
href : "#" }
href : "#" }
);
var nav_wrap = $('nav#nav-wrap')
var nav = $("ul#nav");
var nav = $("ul#nav");

/* id JS is enabled, remove the two a.mobile-btns
/* id JS is enabled, remove the two a.mobile-btns
and dynamically prepend a.toggle-btn to #nav-wrap */
nav_wrap.find('a.mobile-btn').remove();
nav_wrap.prepend(toggle_button);
nav_wrap.find('a.mobile-btn').remove();
nav_wrap.prepend(toggle_button);

toggle_button.on("click", function(e) {
e.preventDefault();
nav.slideToggle("fast");
nav.slideToggle("fast");
});

if (toggle_button.is(':visible')) nav.addClass('mobile');
Expand All @@ -51,8 +51,8 @@
else nav.removeClass('mobile');
});

$('ul#nav li a').on("click", function(){
if (nav.hasClass('mobile')) nav.fadeOut('fast');
$('ul#nav li a').on("click", function(){
if (nav.hasClass('mobile')) nav.fadeOut('fast');
});


Expand All @@ -70,7 +70,7 @@
/* Smooth Scrolling
------------------------------------------------------ */
$('.smoothscroll').on('click', function (e) {

e.preventDefault();

var target = this.hash,
Expand Down Expand Up @@ -120,27 +120,27 @@
/* Waypoints Animations
------------------------------------------------------ */
$('.js .design').waypoint(function() {
$('.js .design .feature-media').addClass( 'animated pulse' );
$('.js .design .feature-media').addClass( 'animated pulse' );
}, { offset: 'bottom-in-view' });

$('.js .responsive').waypoint(function() {
$('.js .responsive .feature-media').addClass( 'animated pulse' );
$('.js .responsive .feature-media').addClass( 'animated pulse' );
}, { offset: 'bottom-in-view' });

$('.js .cross-browser').waypoint(function() {
$('.js .cross-browser .feature-media').addClass( 'animated pulse' );
$('.js .cross-browser .feature-media').addClass( 'animated pulse' );
}, { offset: 'bottom-in-view' });

$('.js .video').waypoint(function() {
$('.js .video .feature-media').addClass( 'animated pulse' );
$('.js .video .feature-media').addClass( 'animated pulse' );
}, { offset: 'bottom-in-view' });

$('.js #subscribe').waypoint(function() {
$('.js #subscribe input[type="email"]').addClass( 'animated fadeInLeftBig show' );
$('.js #subscribe input[type="submit"]').addClass( 'animated fadeInRightBig show' );
$('.js #subscribe input[type="email"]').addClass( 'animated fadeInLeftBig show' );
$('.js #subscribe input[type="submit"]').addClass( 'animated fadeInRightBig show' );
}, { offset: 'bottom-in-view' });


/*----------------------------------------------------*/
/* Flexslider
/*----------------------------------------------------*/
Expand Down Expand Up @@ -194,12 +194,12 @@
{
var description = $( 'a[href="' + $( '#imagelightbox' ).attr( 'src' ) + '"] img' ).attr( 'alt' );
if( description.length > 0 )
$( '<div id="imagelightbox-caption">' + description + '</div>' ).appendTo( 'body' );
$( '<div id="imagelightbox-caption">' + description + '</div>' ).appendTo( 'body' );
},
captionOff = function()
{
$( '#imagelightbox-caption' ).remove();
};
};

var instanceA = $( 'a[data-imagelightbox="a"]' ).imageLightbox(
{
Expand All @@ -209,10 +209,10 @@
onLoadEnd: function() { captionOn(); activityIndicatorOff(); }

});
}

}
else {

/*----------------------------------------------------*/
/* prettyPhoto for old IE
/*----------------------------------------------------*/
Expand All @@ -239,9 +239,9 @@
deeplinking: false,
social_tools: false

});
});

}


})(jQuery);
})(jQuery);
Loading