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

on_new_slide Callback Option Implemented #58

Open
wants to merge 2 commits into
base: master
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
2 changes: 1 addition & 1 deletion slideshow/css/supersized.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*

Supersized - Fullscreen Slideshow jQuery Plugin
Version : 3.2.7
Version : 3.2.8
Site : www.buildinternet.com/project/supersized

Author : Sam Dunn
Expand Down
12 changes: 9 additions & 3 deletions slideshow/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<!--
Supersized - Fullscreen Slideshow jQuery Plugin
Version : 3.2.7
Version : 3.2.8
Site : www.buildinternet.com/project/supersized

Author : Sam Dunn
Expand All @@ -23,11 +23,15 @@
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easing.min.js"></script>

<script type="text/javascript" src="js/supersized.3.2.7.min.js"></script>
<script type="text/javascript" src="js/supersized.3.2.8.min.js"></script>
<script type="text/javascript" src="theme/supersized.shutter.min.js"></script>

<script type="text/javascript">

function callback() {
$('.callback-demo').html('The current image URL slide is:<br /><strong>' + api.getField('image') + '</strong>');
}

jQuery(function($){

$.supersized({
Expand All @@ -46,7 +50,8 @@
keyboard_nav : 1, // Keyboard navigation on/off
performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
image_protect : 1, // Disables image dragging and right click with Javascript

on_new_slide : callback, // Calls a function when a new slide/image is loaded

// Size & Position
min_width : 0, // Min width allowed (in pixels)
min_height : 0, // Min height allowed (in pixels)
Expand Down Expand Up @@ -96,6 +101,7 @@
<ul id="demo-block">
<li><a href="http://buildinternet.com/project/supersized/" target="_blank"><img src="img/supersized-logo.png"/></a></li>
<li>Photographers: <a href="http://cargocollective.com/mariakazvan" target="_blank">Maria Kazvan</a>, <a href="http://colindub.com" target="_blank">Colin Wojno</a>, &amp; <a href="http://brookeshaden.com/" target="_blank">Brooke Shaden</a></li>
<li class="callback-demo"></li>
</ul>

<!--End of styles-->
Expand Down
4 changes: 2 additions & 2 deletions slideshow/fade.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<!--
Supersized - Fullscreen Slideshow jQuery Plugin
Version : 3.2.7
Version : 3.2.8
Site : www.buildinternet.com/project/supersized

Author : Sam Dunn
Expand All @@ -23,7 +23,7 @@
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easing.min.js"></script>

<script type="text/javascript" src="js/supersized.3.2.7.min.js"></script>
<script type="text/javascript" src="js/supersized.3.2.8.min.js"></script>
<script type="text/javascript" src="theme/supersized.shutter.min.js"></script>

<script type="text/javascript">
Expand Down
13 changes: 0 additions & 13 deletions slideshow/js/supersized.3.2.7.min.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*

Supersized - Fullscreen Slideshow jQuery Plugin
Version : 3.2.7
Version : 3.2.8
Site : www.buildinternet.com/project/supersized

Author : Sam Dunn
Expand Down Expand Up @@ -174,6 +174,7 @@
base.resizeNow(); // Resize background image
base.launch();
if( typeof theme != 'undefined' && typeof theme._init == "function" ) theme._init(); // Load Theme
if (typeof base.options.on_new_slide == "function") base.options.on_new_slide(); // Fire the callback for initial load
});

if (base.options.slides.length > 1){
Expand Down Expand Up @@ -559,6 +560,10 @@
liveslide.animate({ left: base.$el.width(), avoidTransforms : false }, base.options.transition_speed );
break;
}

// Runs the on_new_slide callback if specified
if (typeof base.options.on_new_slide == "function") base.options.on_new_slide();

return false;
};

Expand Down Expand Up @@ -661,6 +666,10 @@
liveslide.animate({left : 0}, 0 ).animate({ left: -base.$el.width(), avoidTransforms : false }, base.options.transition_speed );
break;
}

// Runs the on_new_slide callback if specified
if (typeof base.options.on_new_slide == "function") base.options.on_new_slide();

return false;
};

Expand Down Expand Up @@ -902,6 +911,7 @@
keyboard_nav : 1, // Keyboard navigation on/off
performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
image_protect : 1, // Disables image dragging and right click with Javascript
on_new_slide : 0, // Callback for when a new image is loaded

// Size & Position
fit_always : 0, // Image will never exceed browser width or height (Ignores min. dimensions)
Expand Down
13 changes: 13 additions & 0 deletions slideshow/js/supersized.3.2.8.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions slideshow/slide.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<!--
Supersized - Fullscreen Slideshow jQuery Plugin
Version : 3.2.7
Version : 3.2.8
Site : www.buildinternet.com/project/supersized

Author : Sam Dunn
Expand All @@ -23,7 +23,7 @@
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easing.min.js"></script>

<script type="text/javascript" src="js/supersized.3.2.7.min.js"></script>
<script type="text/javascript" src="js/supersized.3.2.8.min.js"></script>
<script type="text/javascript" src="theme/supersized.shutter.min.js"></script>

<script type="text/javascript">
Expand Down
2 changes: 1 addition & 1 deletion slideshow/theme/supersized.shutter.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*

Supersized - Fullscreen Slideshow jQuery Plugin
Version : 3.2.7
Version : 3.2.8
Site : www.buildinternet.com/project/supersized

Theme : Shutter 1.2
Expand Down
2 changes: 1 addition & 1 deletion slideshow/theme/supersized.shutter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*

Supersized - Fullscreen Slideshow jQuery Plugin
Version : 3.2.7
Version : 3.2.8
Theme : Shutter 1.1

Site : www.buildinternet.com/project/supersized
Expand Down
2 changes: 1 addition & 1 deletion slideshow/theme/supersized.shutter.min.js

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