Closed roelvanduijnhoven closed 10 years ago
What about this.
If I needed to add a div into the ‘thumbs div’ so that I could dynamically add text in there. I also need to know how to add the navigation arrows to the navigation of the thumbs
finally I would love to know how access the style tag that is being added via javascript to the main images so that I could change the pixels that is currently pushing the next and previous images out of view.
Please help me with this.. You don’t have to tell me line for line how to do this, but can you please tell me where in your javascript does what. I can not make any sense of the code and there are no comments in there telling me what I need to go.
I would even be willing to pay for your help, if the amount is not off the charts. but I think my questions are simple enough for someone as good as you sir.
Please respond.
Thank you Jasen
@roelvanduijnhoven and @yhwhdesign please check the code I attached in https://github.com/artpolikarpov/fotorama/issues/208
Fixed: http://jsfiddle.net/6uw5b/1/
I just now saw the message so I will check it out..
Thank you very much!!!
Jasen Burkett / Web Developer Arkansas Online Office: 501.378.3829 / Cell: 501.615.4754 jburkett@arkansasonline.com / arkansasonline.com
The information contained in this electronic message is intended for the exclusive use of the individual or entity named above and may contain privileged or confidential copyrighted information. If the reader of this message is not the intended recipient or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that dissemination, distribution or copying of this information is prohibited. If you have received this communication in error, please notify the sender immediately.
On Mar 29, 2014, at 9:08 AM, Ferhat notifications@github.com wrote:
@roelvanduijnhoven and @yhwhdesign please check the code I attached #208
— Reply to this email directly or view it on GitHub.
I re read my questions and they were not very good.
Here is a more accurate list of what I am looking to do, and again I am not wanting you to do all the work, you have done such an amazing job on the slider, however the tweaks I need to do, I would rather do myself, I just do not know how to find the components in the javascript to do so.
I need to find where in the javascript that the thumbnails are being made so that I can add a div container underneath them.
I need to know where in the javascript I can add navigation arrows that match the ones on the full image, however i need to place them on the thumbs.
There is some ‘style’ tags that are being added via the javascript to make the next and previous images be hidden out of view, however I need to know how to edit the margin and the left style that is being added to those images so that I can pull them in next to the active image.
Finally, in the javascript and or the css, there is the code that makes the arrows fade away when you move your mouse on and off the slider… how could I find this code so that I can add it to other components in this slider.
I am willing to pay for the information, I do not have a lot of money but I know you have to be busy and may not have time to just answer all of my questions.
The above questions are all that I have, and would be forever grateful if you would please let me know the answers.
thank you for your time its much appreciated.
Jasen Burkett / Web Developer Arkansas Online Office: 501.378.3829 / Cell: 501.615.4754 jburkett@arkansasonline.com / arkansasonline.com
The information contained in this electronic message is intended for the exclusive use of the individual or entity named above and may contain privileged or confidential copyrighted information. If the reader of this message is not the intended recipient or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that dissemination, distribution or copying of this information is prohibited. If you have received this communication in error, please notify the sender immediately.
On Mar 31, 2014, at 8:50 AM, Jasen Burkett jburkett@arkansasonline.com wrote:
I just now saw the message so I will check it out..
Thank you very much!!!
Jasen Burkett / Web Developer Arkansas Online Office: 501.378.3829 / Cell: 501.615.4754 jburkett@arkansasonline.com / arkansasonline.com
The information contained in this electronic message is intended for the exclusive use of the individual or entity named above and may contain privileged or confidential copyrighted information. If the reader of this message is not the intended recipient or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that dissemination, distribution or copying of this information is prohibited. If you have received this communication in error, please notify the sender immediately.
On Mar 29, 2014, at 9:08 AM, Ferhat notifications@github.com wrote:
@roelvanduijnhoven and @yhwhdesign please check the code I attached #208
— Reply to this email directly or view it on GitHub.
@yhwhdesign
I need to find where in the javascript that the thumbnails are being made so that I can add a div container underneath them. Look for
$navThumbFrame
, it starts here: https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L294I need to know where in the javascript I can add navigation arrows that match the ones on the full image, however i need to place them on the thumbs. The
thumbsDraw() and loadImg()
functions are responsible for showing you the thumbs. https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L641 https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L419There is some ‘style’ tags that are being added via the javascript to make the next and previous images be hidden out of view […] Just use
overflow: hidden;
and set a width.Finally, in the javascript and or the css, there is the code that makes the arrows fade away […] CSS3 transitions are responsible for the fade effect, see here: https://github.com/artpolikarpov/fotorama/blob/master/src/scss/_arrows.scss#L165
I greatly appreciate your time and help on this. I will go through the solutions you provided and make the changes.
If I have any further questions I will let you know but I think you have taken care of any / all issues.
Thank you greatly!!!!
Jasen Burkett / Web Developer Arkansas Online Office: 501.378.3829 / Cell: 501.615.4754 jburkett@arkansasonline.com / arkansasonline.com
The information contained in this electronic message is intended for the exclusive use of the individual or entity named above and may contain privileged or confidential copyrighted information. If the reader of this message is not the intended recipient or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that dissemination, distribution or copying of this information is prohibited. If you have received this communication in error, please notify the sender immediately.
On Apr 1, 2014, at 12:08 PM, Ferhat notifications@github.com wrote:
@yhwhdesign
I need to find where in the javascript that the thumbnails are being made so that I can add a div container underneath them. Look for $navThumbFrame, it starts here: https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L294
I need to know where in the javascript I can add navigation arrows that match the ones on the full image, however i need to place them on the thumbs. The thumbsDraw() and loadImg() functions are responsible for showing you the thumbs. https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L641 https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L419
There is some ‘style’ tags that are being added via the javascript to make the next and previous images be hidden out of view […] Just use overflow: hidden; and set a width.
Finally, in the javascript and or the css, there is the code that makes the arrows fade away […] CSS3 transitions are responsible for the fade effect, see here: https://github.com/artpolikarpov/fotorama/blob/master/src/scss/_arrows.scss#L165
— Reply to this email directly or view it on GitHub.
Quick question. I noticed that in your js file your referencing on the first link… that is not the same js file I have. Is the one you referenced a newer file? on line 294 i have the following: }
the one you showed me looks totally different!
Please advise
Jasen Burkett / Web Developer Arkansas Online Office: 501.378.3829 / Cell: 501.615.4754 jburkett@arkansasonline.com / arkansasonline.com
The information contained in this electronic message is intended for the exclusive use of the individual or entity named above and may contain privileged or confidential copyrighted information. If the reader of this message is not the intended recipient or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that dissemination, distribution or copying of this information is prohibited. If you have received this communication in error, please notify the sender immediately.
On Apr 1, 2014, at 12:08 PM, Ferhat notifications@github.com wrote:
@yhwhdesign
I need to find where in the javascript that the thumbnails are being made so that I can add a div container underneath them. Look for $navThumbFrame, it starts here: https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L294
I need to know where in the javascript I can add navigation arrows that match the ones on the full image, however i need to place them on the thumbs. The thumbsDraw() and loadImg() functions are responsible for showing you the thumbs. https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L641 https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L419
There is some ‘style’ tags that are being added via the javascript to make the next and previous images be hidden out of view […] Just use overflow: hidden; and set a width.
Finally, in the javascript and or the css, there is the code that makes the arrows fade away […] CSS3 transitions are responsible for the fade effect, see here: https://github.com/artpolikarpov/fotorama/blob/master/src/scss/_arrows.scss#L165
— Reply to this email directly or view it on GitHub.
Question. The master files do not work, some of the examples work but why is this file set different from the website version? and why does it not work, unlike the website version the only trouble is with the javascript file.
What am I missing?
Jasen Burkett / Web Developer Arkansas Online Office: 501.378.3829 / Cell: 501.615.4754 jburkett@arkansasonline.com / arkansasonline.com
The information contained in this electronic message is intended for the exclusive use of the individual or entity named above and may contain privileged or confidential copyrighted information. If the reader of this message is not the intended recipient or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that dissemination, distribution or copying of this information is prohibited. If you have received this communication in error, please notify the sender immediately.
On Apr 1, 2014, at 12:08 PM, Ferhat notifications@github.com wrote:
@yhwhdesign
I need to find where in the javascript that the thumbnails are being made so that I can add a div container underneath them. Look for $navThumbFrame, it starts here: https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L294
I need to know where in the javascript I can add navigation arrows that match the ones on the full image, however i need to place them on the thumbs. The thumbsDraw() and loadImg() functions are responsible for showing you the thumbs. https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L641 https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L419
There is some ‘style’ tags that are being added via the javascript to make the next and previous images be hidden out of view […] Just use overflow: hidden; and set a width.
Finally, in the javascript and or the css, there is the code that makes the arrows fade away […] CSS3 transitions are responsible for the fade effect, see here: https://github.com/artpolikarpov/fotorama/blob/master/src/scss/_arrows.scss#L165
— Reply to this email directly or view it on GitHub.
The version I referenced is from the master branch and upstream is usually more recent than the code you may have localy. So, I'd suggest you do a git fetch && git pull
in your local repository first. meanwhile @artpolikarpov released version 4.5.1
I was able to find the similar code in the output files that was made. Compared to the code you showed me. However its just the lack of knowing how he uses javascript to build the div containers, etc. that is bogging me down. I hope to figure it out soon.
Jasen Burkett / Web Developer Arkansas Online Office: 501.378.3829 / Cell: 501.615.4754 jburkett@arkansasonline.com / arkansasonline.com
The information contained in this electronic message is intended for the exclusive use of the individual or entity named above and may contain privileged or confidential copyrighted information. If the reader of this message is not the intended recipient or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that dissemination, distribution or copying of this information is prohibited. If you have received this communication in error, please notify the sender immediately.
On Apr 2, 2014, at 9:49 AM, Jasen Burkett jburkett@arkansasonline.com wrote:
Question. The master files do not work, some of the examples work but why is this file set different from the website version? and why does it not work, unlike the website version the only trouble is with the javascript file.
What am I missing?
Jasen Burkett / Web Developer Arkansas Online Office: 501.378.3829 / Cell: 501.615.4754 jburkett@arkansasonline.com / arkansasonline.com
The information contained in this electronic message is intended for the exclusive use of the individual or entity named above and may contain privileged or confidential copyrighted information. If the reader of this message is not the intended recipient or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that dissemination, distribution or copying of this information is prohibited. If you have received this communication in error, please notify the sender immediately.
On Apr 1, 2014, at 12:08 PM, Ferhat notifications@github.com wrote:
@yhwhdesign
I need to find where in the javascript that the thumbnails are being made so that I can add a div container underneath them. Look for $navThumbFrame, it starts here: https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L294
I need to know where in the javascript I can add navigation arrows that match the ones on the full image, however i need to place them on the thumbs. The thumbsDraw() and loadImg() functions are responsible for showing you the thumbs. https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L641 https://github.com/artpolikarpov/fotorama/blob/master/src/js/fotorama.js#L419
There is some ‘style’ tags that are being added via the javascript to make the next and previous images be hidden out of view […] Just use overflow: hidden; and set a width.
Finally, in the javascript and or the css, there is the code that makes the arrows fade away […] CSS3 transitions are responsible for the fade effect, see here: https://github.com/artpolikarpov/fotorama/blob/master/src/scss/_arrows.scss#L165
— Reply to this email directly or view it on GitHub.
Can you do a quick fiddle on the following to help me again? If not I understand.
I thank you for your time, and if I need to pay you for the answers to the above questions let me know how much it would cost, I don’t have much but I can try to give you something.
I still can not get anything to work, and Im not sure where to start… I have attached my files
to this email so that you can see what I am working with. The javascript and the css files are copied and pasted below.
/*!
Fotorama 4.5.1 | http://fotorama.io/license/ */ (function (window, document, location, $, undefined) { "use strict"; var _fotoramaClass = 'fotorama', _fullscreenClass = 'fullscreen',
wrapClass = _fotoramaClass + '__wrap', wrapCss2Class = wrapClass + '--css2', wrapCss3Class = wrapClass + '--css3', wrapVideoClass = wrapClass + '--video', wrapFadeClass = wrapClass + '--fade', wrapSlideClass = wrapClass + '--slide', wrapNoControlsClass = wrapClass + '--no-controls', wrapNoShadowsClass = wrapClass + '--no-shadows', wrapPanYClass = wrapClass + '--pan-y', wrapRtlClass = wrapClass + '--rtl', wrapOnlyActiveClass = wrapClass + '--only-active',
wrapNoCaptionsClass = wrapClass + '--no-captions', /* adding for the gallery title attempt of adding */ wrapNoTitlesClass = wrapClass + '--no-titles',
wrapToggleArrowsClass = wrapClass + '--toggle-arrows',
stageClass = _fotoramaClass + 'stage', stageFrameClass = stageClass + 'frame', stageFrameVideoClass = stageFrameClass + '--video', stageShaftClass = stageClass + '__shaft',
grabClass = _fotoramaClass + '__grab', pointerClass = _fotoramaClass + '__pointer',
arrClass = _fotoramaClass + 'arr', arrDisabledClass = arrClass + '--disabled', arrPrevClass = arrClass + '--prev', arrNextClass = arrClass + '--next', arrArrClass = arrClass + 'arr',
navClass = _fotoramaClass + 'nav', navWrapClass = navClass + '-wrap', navShaftClass = navClass + 'shaft', navDotsClass = navClass + '--dots', navThumbsClass = navClass + '--thumbs', navFrameClass = navClass + '__frame', navFrameDotClass = navFrameClass + '--dot', navFrameThumbClass = navFrameClass + '--thumb',
fadeClass = _fotoramaClass + '__fade', fadeFrontClass = fadeClass + '-front', fadeRearClass = fadeClass + '-rear',
shadowClass = _fotoramaClass + '__shadow', shadowsClass = shadowClass + 's', shadowsLeftClass = shadowsClass + '--left', shadowsRightClass = shadowsClass + '--right',
activeClass = _fotoramaClass + '__active', selectClass = _fotoramaClass + '__select',
hiddenClass = _fotoramaClass + '--hidden',
fullscreenClass = _fotoramaClass + '--fullscreen', fullscreenIconClass = _fotoramaClass + '__fullscreen-icon',
errorClass = _fotoramaClass + 'error', loadingClass = _fotoramaClass + '__loading', loadedClass = _fotoramaClass + 'loaded', loadedFullClass = loadedClass + '--full', loadedImgClass = loadedClass + '--img',
grabbingClass = _fotoramaClass + '__grabbing',
imgClass = _fotoramaClass + '__img', imgFullClass = imgClass + '--full',
dotClass = _fotoramaClass + '__dot', thumbClass = _fotoramaClass + '__thumb', thumbBorderClass = thumbClass + '-border',
htmlClass = _fotoramaClass + '__html',
videoClass = _fotoramaClass + '__video', videoPlayClass = videoClass + '-play', videoCloseClass = videoClass + '-close',
captionClass = _fotoramaClass + '__caption', captionWrapClass = _fotoramaClass + 'captionwrap',
/* adding of the gallery title attempt */ titleClass = _fotoramaClass + '__title', titleWrapClass = _fotoramaClass + 'titlewrap',
spinnerClass = _fotoramaClass + '__spinner'; var JQUERY_VERSION = $ && $.fn.jquery.split('.');
if (!JQUERY_VERSION || JQUERY_VERSION[0] < 1 || (JQUERY_VERSION[0] == 1 && JQUERYVERSION[1] < 8)) { throw 'Fotorama requires jQuery 1.8 or later and will not run without it.'; return; } // My Underscore :-) var = {}; /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
var Modernizr = (function (window, document, undefined) {
var version = '2.6.2',
Modernizr = {},
docElement = document.documentElement,
mod = 'modernizr',
modElem = document.createElement(mod),
mStyle = modElem.style,
inputElem,
toString = {}.toString,
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
omPrefixes = 'Webkit Moz O ms',
cssomPrefixes = omPrefixes.split(' '),
domPrefixes = omPrefixes.toLowerCase().split(' '),
tests = {},
inputs = {},
attrs = {},
classes = [],
slice = classes.slice,
featureName,
injectElementWithStyles = function (rule, callback, nodes, testnames) {
var style, ret, node, docOverflow,
div = document.createElement('div'),
body = document.body,
fakeBody = body || document.createElement('body');
if (parseInt(nodes, 10)) {
while (nodes--) {
node = document.createElement('div');
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
div.appendChild(node);
}
}
style = ['­', '<style id="s', mod, '">', rule, '</style>'].join('');
div.id = mod;
(body ? div : fakeBody).innerHTML += style;
fakeBody.appendChild(div);
if (!body) {
fakeBody.style.background = '';
fakeBody.style.overflow = 'hidden';
docOverflow = docElement.style.overflow;
docElement.style.overflow = 'hidden';
docElement.appendChild(fakeBody);
}
ret = callback(div, rule);
if (!body) {
fakeBody.parentNode.removeChild(fakeBody);
docElement.style.overflow = docOverflow;
} else {
div.parentNode.removeChild(div);
}
return !!ret;
},
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
if (!is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined')) { hasOwnProp = function (object, property) { return _hasOwnProperty.call(object, property); }; } else { hasOwnProp = function (object, property) { return ((property in object) && is(object.constructor.prototype[property], 'undefined')); }; }
if (!Function.prototype.bind) { Function.prototype.bind = function bind (that) {
var target = this;
if (typeof target != "function") {
throw new TypeError();
}
var args = slice.call(arguments, 1),
bound = function () {
if (this instanceof bound) {
var F = function () {
};
F.prototype = target.prototype;
var self = new F();
var result = target.apply(
self,
args.concat(slice.call(arguments))
);
if (Object(result) === result) {
return result;
}
return self;
} else {
return target.apply(
that,
args.concat(slice.call(arguments))
);
}
};
return bound;
};
}
function setCss (str) { mStyle.cssText = str; }
function setCssAll (str1, str2) { return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); }
function is (obj, type) { return typeof obj === type; }
function contains (str, substr) { return !!~('' + str).indexOf(substr); }
function testProps (props, prefixed) { for (var i in props) { var prop = props[i]; if (!contains(prop, "-") && mStyle[prop] !== undefined) { return prefixed == 'pfx' ? prop : true; } } return false; }
function testDOMProps (props, obj, elem) { for (var i in props) { var item = obj[props[i]]; if (item !== undefined) {
if (elem === false) return props[i];
if (is(item, 'function')) {
return item.bind(elem || obj);
}
return item;
}
}
return false;
}
function testPropsAll (prop, prefixed, elem) {
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
if (is(prefixed, "string") || is(prefixed, "undefined")) {
return testProps(props, prefixed);
} else {
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
return testDOMProps(props, prefixed, elem);
}
}
tests['csstransforms3d'] = function () {
var ret = !!testPropsAll('perspective');
// Chrome fails that test, ignore // if (ret && 'webkitPerspective' in docElement.style) { // // injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function (node, rule) { // ret = node.offsetLeft === 9 && node.offsetHeight === 3; // }); // } return ret; };
for (var feature in tests) { if (hasOwnProp(tests, feature)) { featureName = feature.toLowerCase(); Modernizr[featureName] = tests[feature]();
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
}
}
Modernizr.addTest = function (feature, test) { if (typeof feature == 'object') { for (var key in feature) { if (hasOwnProp(feature, key)) { Modernizr.addTest(key, feature[ key ]); } } } else {
feature = feature.toLowerCase();
if (Modernizr[feature] !== undefined) {
return Modernizr;
}
test = typeof test == 'function' ? test() : test;
if (typeof enableClasses !== "undefined" && enableClasses) {
docElement.className += ' ' + (test ? '' : 'no-') + feature;
}
Modernizr[feature] = test;
}
return Modernizr;
};
setCss(''); modElem = inputElem = null;
Modernizr._version = version;
Modernizr._prefixes = prefixes; Modernizr._domPrefixes = domPrefixes; Modernizr._cssomPrefixes = cssomPrefixes;
Modernizr.testProp = function (prop) { return testProps([prop]); };
Modernizr.testAllProps = testPropsAll;
Modernizr.testStyles = injectElementWithStyles; Modernizr.prefixed = function (prop, obj, elem) { if (!obj) { return testPropsAll(prop, 'pfx'); } else { return testPropsAll(prop, obj, elem); } };
return Modernizr; })(window, document); var fullScreenApi = { ok: false, is: function () { return false; }, request: function () { }, cancel: function () { }, event: '', prefix: '' }, browserPrefixes = 'webkit moz o ms khtml'.split(' ');
// check for native support if (typeof document.cancelFullScreen != 'undefined') { fullScreenApi.ok = true; } else { // check for fullscreen support by vendor prefix for (var i = 0, il = browserPrefixes.length; i < il; i++) { fullScreenApi.prefix = browserPrefixes[i]; if (typeof document[fullScreenApi.prefix + 'CancelFullScreen' ] != 'undefined') { fullScreenApi.ok = true; break; } } }
// update methods to do something useful if (fullScreenApi.ok) { fullScreenApi.event = fullScreenApi.prefix + 'fullscreenchange'; fullScreenApi.is = function () { switch (this.prefix) { case '': return document.fullScreen; case 'webkit': return document.webkitIsFullScreen; default: return document[this.prefix + 'FullScreen']; } }; fullScreenApi.request = function (el) { return (this.prefix === '') ? el.requestFullScreen() : el[this.prefix + 'RequestFullScreen'](); }; fullScreenApi.cancel = function (el) { return (this.prefix === '') ? document.cancelFullScreen() : document[this.prefix + 'CancelFullScreen'](); }; } //fgnass.github.com/spin.js#v1.3.2
/**
var Spinner, spinnerDefaults = { lines: 12, // The number of lines to draw length: 5, // The length of each line width: 2, // The line thickness radius: 7, // The radius of the inner circle corners: 1, // Corner roundness (0..1) rotate: 15, // The rotation offset color: 'rgba(128, 128, 128, .75)', hwaccel: true }, spinnerOverride = { top: 'auto', left: 'auto', className: '' };
(function(root, factory) {
/* CommonJS */ //if (typeof exports == 'object') module.exports = factory()
/* AMD module */ //else if (typeof define == 'function' && define.amd) define(factory)
/* Browser global */ //else root.Spinner = factory()
Spinner = factory(); } (this, function() { "use strict";
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes / , animations = {} / Animation rules keyed by their name / , useCssAnimations / Whether to use CSS animations or setTimeout */
/**
a DIV is created. Optionally properties can be passed. */ function createEl(tag, prop) { var el = document.createElement(tag || 'div') , n
for(n in prop) el[n] = prop[n] return el }
/**
Appends children and returns the parent. / function ins(parent / child1, child2, ...*/) { for (var i=1, n=arguments.length; i<n; i++) parent.appendChild(arguments[i])
return parent }
/**
Insert a new stylesheet to hold the @keyframe or VML rules. */ var sheet = (function() { var el = createEl('style', {type : 'text/css'}) ins(document.getElementsByTagName('head')[0], el) return el.sheet || el.styleSheet }())
/**
we create separate rules for each line/segment. _/ function addAnimation(alpha, trail, i, lines) { var name = ['opacity', trail, ~~(alpha_100), i, lines].join('-') , start = 0.01 + i/lines * 100 , z = Math.max(1 - (1-alpha) / trail * (100-start), alpha) , prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase() , pre = prefix && '-' + prefix + '-' || ''
if (!animations[name]) { sheet.insertRule( '@' + pre + 'keyframes ' + name + '{' + '0%{opacity:' + z + '}' + start + '%{opacity:' + alpha + '}' + (start+0.01) + '%{opacity:1}' + (start+trail) % 100 + '%{opacity:' + alpha + '}' + '100%{opacity:' + z + '}' + '}', sheet.cssRules.length)
animations[name] = 1
}
return name }
/**
Tries various vendor prefixes and returns the first supported property. */ function vendor(el, prop) { var s = el.style , pp , i
prop = prop.charAt(0).toUpperCase() + prop.slice(1) for(i=0; i<prefixes.length; i++) { pp = prefixes[i]+prop if(s[pp] !== undefined) return pp } if(s[prop] !== undefined) return prop }
/**
Sets multiple style properties at once. */ function css(el, prop) { for (var n in prop) el.style[vendor(el, n)||n] = prop[n]
return el }
/**
Fills in default values. */ function merge(obj) { for (var i=1; i < arguments.length; i++) { var def = arguments[i] for (var n in def) if (obj[n] === undefined) obj[n] = def[n] } return obj }
/**
Returns the absolute page-offset of the given element. */ function pos(el) { var o = { x:el.offsetLeft, y:el.offsetTop } while((el = el.offsetParent)) o.x+=el.offsetLeft, o.y+=el.offsetTop
return o }
/**
Returns the line color from the given string or array. */ function getColor(color, idx) { return typeof color == 'string' ? color : color[idx % color.length] }
// Built-in defaults
var defaults = { lines: 12, // The number of lines to draw length: 7, // The length of each line width: 5, // The line thickness radius: 10, // The radius of the inner circle rotate: 0, // Rotation offset corners: 1, // Roundness (0..1) color: '#000', // #rgb or #rrggbb direction: 1, // 1: clockwise, -1: counterclockwise speed: 1, // Rounds per second trail: 100, // Afterglow percentage opacity: 1/4, // Opacity of the lines fps: 20, // Frames per second when using setTimeout() zIndex: 2e9, // Use a high z-index by default className: 'spinner', // CSS class to assign to the element top: 'auto', // center vertically left: 'auto', // center horizontally position: 'relative' // element position }
/* The constructor / function Spinner(o) { if (typeof this == 'undefined') return new Spinner(o) this.opts = merge(o || {}, Spinner.defaults, defaults) }
// Global defaults that override the built-ins: Spinner.defaults = {}
merge(Spinner.prototype, {
/**
stop() internally. */ spin: function(target) { this.stop()
var self = this , o = self.opts , el = self.el = css(createEl(0, {className: o.className}), {position: o.position, width: 0, zIndex: o.zIndex}) , mid = o.radius+o.length+o.width , ep // element position , tp // target position
if (target) { target.insertBefore(el, target.firstChild||null) tp = pos(target) ep = pos(el) css(el, { left: (o.left == 'auto' ? tp.x-ep.x + (target.offsetWidth >> 1) : parseInt(o.left, 10) + mid) + 'px', top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : parseInt(o.top, 10) + mid) + 'px' }) }
el.setAttribute('role', 'progressbar') self.lines(el, self.opts)
if (!useCssAnimations) { // No CSS animation support, use setTimeout() instead var i = 0 , start = (o.lines - 1) * (1 - o.direction) / 2 , alpha , fps = o.fps , f = fps/o.speed , ostep = (1-o.opacity) / (f*o.trail / 100) , astep = f/o.lines
;(function anim() {
i++;
for (var j = 0; j < o.lines; j++) {
alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity)
self.opacity(el, j * o.direction + start, alpha, o)
}
self.timeout = self.el && setTimeout(anim, ~~(1000/fps))
})()
} return self },
/**
/**
in VML fallback mode below. / lines: function(el, o) { var i = 0 , start = (o.lines - 1) \ (1 - o.direction) / 2 , seg
function fill(color, shadow) { return css(createEl(), { position: 'absolute', width: (o.length+o.width) + 'px', height: o.width + 'px', background: color, boxShadow: shadow, transformOrigin: 'left', transform: 'rotate(' + ~~(360/o.linesi+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)', borderRadius: (o.corners \ o.width>>1) + 'px' }) }
for (; i < o.lines; i++) { seg = css(createEl(), { position: 'absolute', top: 1+~(o.width/2) + 'px', transform: o.hwaccel ? 'translate3d(0,0,0)' : '', opacity: o.opacity, animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1/o.speed + 's linear infinite' })
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'}))
ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')))
} return el },
/**
})
function initVML() {
/* Utility function to create a VML tag */ function vml(tag, attr) { return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr) }
// No CSS transforms but VML support, add a CSS rule for VML elements: sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')
Spinner.prototype.lines = function(el, o) { var r = o.length+o.width , s = 2*r
function grp() {
return css(
vml('group', {
coordsize: s + ' ' + s,
coordorigin: -r + ' ' + -r
}),
{ width: s, height: s }
)
}
var margin = -(o.width+o.length)*2 + 'px'
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
, i
function seg(i, dx, filter) {
ins(g,
ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}),
ins(css(vml('roundrect', {arcsize: o.corners}), {
width: r,
height: o.width,
left: o.radius,
top: -o.width>>1,
filter: filter
}),
vml('fill', {color: getColor(o.color, i), opacity: o.opacity}),
vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
)
)
)
}
if (o.shadow)
for (i = 1; i <= o.lines; i++)
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
for (i = 1; i <= o.lines; i++) seg(i)
return ins(el, g)
}
Spinner.prototype.opacity = function(el, i, val, o) { var c = el.firstChild o = o.shadow && o.lines || 0 if (c && i+o < c.childNodes.length) { c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild if (c) c.opacity = val } } }
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'})
if (!vendor(probe, 'transform') && probe.adj) initVML() else useCssAnimations = vendor(probe, 'animation')
return Spinner
}));
/* Bez v1.0.10-g5ae0136
Provided under the FreeBSD license: https://github.com/rdallasgray/bez/blob/master/LICENSE.txt / function bez (coOrdArray) { var encodedFuncName = "bez" + $.makeArray(arguments).join("").replace(".", "p"); if (typeof $['easing'][encodedFuncName] !== "function") { var polyBez = function (p1, p2) { var A = [null, null], B = [null, null], C = [null, null], bezCoOrd = function (t, ax) { C[ax] = 3 * p1[ax]; B[ax] = 3 * (p2[ax] - p1[ax]) - C[ax]; A[ax] = 1 - C[ax] - B[ax]; return t * (C[ax] + t * (B[ax] + t * A[ax])); }, xDeriv = function (t) { return C[0] + t * (2 * B[0] + 3 * A[0] * t); }, xForT = function (t) { var x = t, i = 0, z; while (++i < 14) { z = bezCoOrd(x, 0) - t; if (Math.abs(z) < 1e-3) break; x -= z / xDeriv(x); } return x; }; return function (t) { return bezCoOrd(xForT(t), 1); } }; $['easing'][encodedFuncName] = function (x, t, b, c, d) { return c \ polyBez([coOrdArray[0], coOrdArray[1]], [coOrdArray[2], coOrdArray[3]])(t / d) + b; } } return encodedFuncName; } var $WINDOW = $(window), $DOCUMENT = $(document), $HTML, $BODY,
QUIRKS_FORCE = location.hash.replace('#', '') === 'quirks', TRANSFORMS3D = Modernizr.csstransforms3d, CSS3 = TRANSFORMS3D && !QUIRKS_FORCE, COMPAT = TRANSFORMS3D || document.compatMode === 'CSS1Compat', FULLSCREEN = fullScreenApi.ok,
MOBILE = navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i), SLOW = !CSS3 || MOBILE,
ADD_EVENT_LISTENER = 'addEventListener',
MS_POINTER = navigator.msPointerEnabled,
WHEEL = "onwheel" in document.createElement("div") ? "wheel" : document.onmousewheel !== undefined ? "mousewheel" : "DOMMouseScroll",
TOUCH_TIMEOUT = 250, TRANSITION_DURATION = 300,
SCROLL_LOCK_TIMEOUT = 1400,
AUTOPLAY_INTERVAL = 5000, MARGIN = 2, THUMB_SIZE = 64,
WIDTH = 500, HEIGHT = 333,
STAGE_FRAME_KEY = '$stageFrame', NAV_DOT_FRAME_KEY = '$navDotFrame', NAV_THUMB_FRAME_KEY = '$navThumbFrame',
BEZIER = bez([.1, 0, .25, 1]),
MAX_WIDTH = 99999,
OPTIONS = { // dimensions width: null, // 500 || '100%' minwidth: null, maxwidth: '100%', // '100%' height: null, minheight: null, maxheight: null,
ratio: null, // '16/9' || 500/333 || 1.5
margin: MARGIN, glimpse: 0,
// navigation, thumbs nav: 'dots', // 'thumbs' || false navposition: 'bottom', // 'top' navwidth: null, thumbwidth: THUMB_SIZE, thumbheight: THUMB_SIZE, thumbmargin: MARGIN, thumbborderwidth: MARGIN,
allowfullscreen: false, // true || 'native'
fit: 'contain', // 'cover' || 'scaledown' || 'none'
transition: 'slide', // 'crossfade' || 'dissolve' clicktransition: null, transitionduration: TRANSITION_DURATION,
captions: true,
/* attempting to add the gallery title components */ titles: false,
hash: false, startindex: 0,
loop: false,
autoplay: false, stopautoplayontouch: true,
keyboard: false,
arrows: true, click: true, swipe: true, trackpad: true,
shuffle: false,
direction: 'ltr', // 'rtl'
shadows: true, spinner: null },
KEYBOARD_OPTIONS = { left: true, right: true, down: false, up: false, space: false, home: false, end: false }; function noop () {}
function minMaxLimit (value, min, max) { return Math.max(isNaN(min) ? -Infinity : min, Math.min(isNaN(max) ? Infinity : max, value)); }
function readTransform (css) { return css.match(/ma/) && css.match(/-?\d+(?!d)/g)[css.match(/3d/) ? 12 : 4]; }
function readPosition ($el) { if (CSS3) { return +readTransform($el.css('transform')); } else { return +$el.css('left').replace('px', ''); } }
function getTranslate (pos, _001) { var obj = {}; if (CSS3) { obj.transform = 'translate3d(' + (pos + (_001 ? 0.001 : 0)) + 'px,0,0)'; // 0.001 to remove Retina artifacts } else { obj.left = pos; } return obj; }
function getDuration (time) { return {'transition-duration': time + 'ms'}; }
function numberFromMeasure (value, measure) { return +String(value).replace(measure || 'px', '') || undefined; }
function numberFromPercent (value) { return /%$/.test(value) && numberFromMeasure(value, '%'); }
function numberFromWhatever (value, whole) { return numberFromPercent(value) / 100 * whole || numberFromMeasure(value); }
function measureIsValid (value) { return (!!numberFromMeasure(value) || !!numberFromMeasure(value, '%')) && value; }
function getPosByIndex (index, side, margin, baseIndex) { return (index - (baseIndex || 0)) * (side + (margin || 0)); }
function getIndexByPos (pos, side, margin, baseIndex) { return -Math.round(pos / (side + (margin || 0)) - (baseIndex || 0)); }
function bindTransitionEnd ($el) { var elData = $el.data();
if (elData.tEnd) return;
var el = $el[0], transitionEndEvent = { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend', msTransition: 'MSTransitionEnd', transition: 'transitionend' }; el.addEventListener(transitionEndEvent[Modernizr.prefixed('transition')], function (e) { elData.tProp && e.propertyName.match(elData.tProp) && elData.onEndFn(); }, false); elData.tEnd = true; }
function afterTransition ($el, property, fn, time) { var ok, elData = $el.data();
if (elData) { elData.onEndFn = function () { if (ok) return; ok = true; clearTimeout(elData.tT); fn(); }; elData.tProp = property;
// Passive call, just in case of fail of native transition-end event
clearTimeout(elData.tT);
elData.tT = setTimeout(function () {
elData.onEndFn();
}, time * 1.5);
bindTransitionEnd($el);
} }
function stop ($el, left, _001) { if ($el.length) { var elData = $el.data(); if (CSS3) { $el.css(getDuration(0)); elData.onEndFn = noop; clearTimeout(elData.tT); } else { $el.stop(); } var lockedLeft = getNumber(left, function () { return readPosition($el); });
$el.css(getTranslate(lockedLeft, _001));//.width(); // `.width()` for reflow
return lockedLeft;
} }
function getNumber () { var number; for (var _i = 0, _l = arguments.length; _i < _l; _i++) { number = _i ? arguments[_i]() : arguments[_i]; if (typeof number === 'number') { break; } }
return number; }
function edgeResistance (pos, edge) { return Math.round(pos + ((edge - pos) / 1.5)); }
function getProtocol () { getProtocol.p = getProtocol.p || (location.protocol === 'https:' ? 'https://' : 'http://'); return getProtocol.p; }
function parseHref (href) { var a = document.createElement('a'); a.href = href; return a; }
function findVideoId (href, forceVideo) { if (typeof href !== 'string') return href; href = parseHref(href);
var id, type;
if (href.host.match(/youtube.com/) && href.search) { //.log(); id = href.search.split('v=')[1]; if (id) { var ampersandPosition = id.indexOf('&'); if (ampersandPosition !== -1) { id = id.substring(0, ampersandPosition); } type = 'youtube'; } } else if (href.host.match(/youtube.com|youtu.be/)) { id = href.pathname.replace(/^\/(embed\/|v\/)?/, '').replace(/\/./, ''); type = 'youtube'; } else if (href.host.match(/vimeo.com/)) { type = 'vimeo'; id = href.pathname.replace(/^\/(video\/)?/, '').replace(/\/./, ''); }
if ((!id || !type) && forceVideo) { id = href.href; type = 'custom'; }
return id ? {id: id, type: type, s: href.search.replace(/^\?/, '')} : false; }
function getVideoThumbs (dataFrame, data, fotorama) { var img, thumb, video = dataFrame.video; if (video.type === 'youtube') { thumb = getProtocol() + 'img.youtube.com/vi/' + video.id + '/default.jpg'; img = thumb.replace(/\/default.jpg$/, '/hqdefault.jpg'); dataFrame.thumbsReady = true; } else if (video.type === 'vimeo') { $.ajax({ url: getProtocol() + 'vimeo.com/api/v2/video/' + video.id + '.json', dataType: 'jsonp', success: function (json) { dataFrame.thumbsReady = true; updateData(data, {img: json[0].thumbnail_large, thumb: json[0].thumbnail_small}, dataFrame.i, fotorama); } }); } else { dataFrame.thumbsReady = true; }
return { img: img, thumb: thumb } }
function updateData (data, _dataFrame, i, fotorama) { for (var _i = 0, _l = data.length; _i < _l; _i++) { var dataFrame = data[_i];
if (dataFrame.i === i && dataFrame.thumbsReady) {
var clear = {videoReady: true};
clear[STAGE_FRAME_KEY] = clear[NAV_THUMB_FRAME_KEY] = clear[NAV_DOT_FRAME_KEY] = false;
fotorama.splice(_i, 1, $.extend(
{},
dataFrame,
clear,
_dataFrame
));
break;
}
} }
function getDataFromHtml ($el) { var data = [];
function getDataFromImg ($img, imgData, checkVideo) { var $child = $img.children('img').eq(0), _imgHref = $img.attr('href'), _imgSrc = $img.attr('src'), _thumbSrc = $child.attr('src'), _video = imgData.video, video = checkVideo ? findVideoId(_imgHref, _video === true) : false;
if (video) {
_imgHref = false;
} else {
video = _video;
}
getDimensions($img, $child, $.extend(imgData, {
video: video,
img: imgData.img || _imgHref || _imgSrc || _thumbSrc,
thumb: imgData.thumb || _thumbSrc || _imgSrc || _imgHref
}));
}
function getDimensions ($img, $child, imgData) { var separateThumbFLAG = imgData.thumb && imgData.img !== imgData.thumb, width = numberFromMeasure(imgData.width || $img.attr('width')), height = numberFromMeasure(imgData.height || $img.attr('height'));
$.extend(imgData, {
width: width,
height: height,
thumbratio: getRatio(imgData.thumbratio || (numberFromMeasure(imgData.thumbwidth || ($child && $child.attr('width')) || separateThumbFLAG || width) / numberFromMeasure(imgData.thumbheight || ($child && $child.attr('height')) || separateThumbFLAG || height)))
});
}
$el.children().each(function () { var $this = $(this), dataFrame = optionsToLowerCase($.extend($this.data(), {id: $this.attr('id')})); if ($this.is('a, img')) { getDataFromImg($this, dataFrame, true); } else if (!$this.is(':empty')) { getDimensions($this, null, $.extend(dataFrame, { html: this, _html: $this.html() // Because of IE })); } else return;
data.push(dataFrame);
});
return data; }
function isHidden (el) { return el.offsetWidth === 0 && el.offsetHeight === 0; }
function isDetached (el) { return !$.contains(document.documentElement, el); }
function waitFor (test, fn, timeout) { if (test()) { fn(); } else { setTimeout(function () { waitFor(test, fn); }, timeout || 100); } }
function setHash (hash) { //console.time('setHash ' + hash); location.replace(location.protocol
function fit ($el, measuresToFit, method) { var elData = $el.data(), measures = elData.measures;
if (measures && (!elData.l || elData.l.W !== measures.width || elData.l.H !== measures.height || elData.l.r !== measures.ratio || elData.l.w !== measuresToFit.w || elData.l.h !== measuresToFit.h || elData.l.m !== method)) { var width = measures.width, height = measures.height, ratio = measuresToFit.w / measuresToFit.h, biggerRatioFLAG = measures.ratio >= ratio, fitFLAG = method === 'scaledown', containFLAG = method === 'contain', coverFLAG = method === 'cover';
if (biggerRatioFLAG && (fitFLAG || containFLAG) || !biggerRatioFLAG && coverFLAG) {
width = minMaxLimit(measuresToFit.w, 0, fitFLAG ? width : Infinity);
height = width / measures.ratio;
} else if (biggerRatioFLAG && coverFLAG || !biggerRatioFLAG && (fitFLAG || containFLAG)) {
height = minMaxLimit(measuresToFit.h, 0, fitFLAG ? height : Infinity);
width = height * measures.ratio;
}
$el.css({
width: Math.ceil(width),
height: Math.ceil(height),
marginLeft: Math.floor(-width / 2),
marginTop: Math.floor(-height / 2)
});
elData.l = {
W: measures.width,
H: measures.height,
r: measures.ratio,
w: measuresToFit.w,
h: measuresToFit.h,
m: method
};
}
return true; }
function setStyle ($el, style) { var el = $el[0]; if (el.styleSheet) { el.styleSheet.cssText = style; } else { $el.html(style); } }
function findShadowEdge (pos, min, max) { return min === max ? false : pos <= min ? 'left' : pos >= max ? 'right' : 'left right'; }
function getIndexFromHash (hash, data, ok, startindex) { if (!ok) return false; if (!isNaN(hash)) return hash - (startindex ? 0 : 1);
var index;
for (var _i = 0, _l = data.length; _i < _l; _i++) { var dataFrame = data[_i];
if (dataFrame.id === hash) {
index = _i;
break;
}
}
return index; }
function smartClick ($el, fn, _options) { _options = _options || {};
$el.each(function () { var $this = $(this), thisData = $this.data(), startEvent;
if (thisData.clickOn) return;
thisData.clickOn = true;
$.extend(touch($this, {
onStart: function (e) {
startEvent = e;
(_options.onStart || noop).call(this, e);
},
onMove: _options.onMove || noop,
onTouchEnd: _options.onTouchEnd || noop,
onEnd: function (result) {
//console.log('smartClick → result.moved', result.moved);
if (result.moved) return;
fn.call(this, startEvent);
}
}), {noMove: true});
}); }
function div (classes, child) { return '
// Fisher–Yates Shuffle // http://bost.ocks.org/mike/shuffle/ function shuffle (array) { // While there remain elements to shuffle var l = array.length; while (l) { // Pick a remaining element var i = Math.floor(Math.random() * l--);
// And swap it with the current element
var t = array[l];
array[l] = array[i];
array[i] = t;
}
return array; }
function clone (array) { return Object.prototype.toString.call(array) == '[object Array]' && $.map(array, function (frame) { return $.extend({}, frame); }); }
function lockScroll (left, top) { $WINDOW .scrollLeft(left) .scrollTop(top); }
function optionsToLowerCase (options) { if (options) { var opts = {}; $.each(options, function (key, value) { opts[key.toLowerCase()] = value; });
return opts;
} }
function getRatio (_ratio) { if (!_ratio) return; var ratio = +_ratio; if (!isNaN(ratio)) { return ratio; } else { ratio = _ratio.split('/'); return +ratio[0] / +ratio[1] || undefined; } }
function stopEvent (e, stopPropagation) { e.preventDefault(); stopPropagation && e.stopPropagation(); }
function getDirectionSign (forward) { return forward ? '>' : '<'; }
function slide ($el, options) { var elData = $el.data(), elPos = Math.round(options.pos), onEndFn = function () { elData.sliding = false; (options.onEnd || noop)(); };
if (typeof options.overPos !== 'undefined' && options.overPos !== options.pos) { elPos = options.overPos; onEndFn = function () { slide($el, $.extend({}, options, {overPos: options.pos, time: Math.max(TRANSITION_DURATION, options.time / 2)})) }; }
//console.time('var translate = $.extend'); var translate = $.extend(getTranslate(elPos, options._001), options.width && {width: options.width}); //console.timeEnd('var translate = $.extend');
elData.sliding = true;
if (CSS3) { $el.css($.extend(getDuration(options.time), translate)); if (options.time > 10) { //console.time('afterTransition'); afterTransition($el, 'transform', onEndFn, options.time); //console.timeEnd('afterTransition'); } else { onEndFn(); } } else { $el.stop().animate(translate, options.time, BEZIER, onEndFn); } }
function fade ($el1, $el2, $frames, options, fadeStack, chain) { var chainedFLAG = typeof chain !== 'undefined'; if (!chainedFLAG) { fadeStack.push(arguments); Array.prototype.push.call(arguments, fadeStack.length); if (fadeStack.length > 1) return; }
$el1 = $el1 || $($el1); $el2 = $el2 || $($el2);
var $el1 = $el1[0], $el2 = $el2[0], crossfadeFLAG = options.method === 'crossfade', onEndFn = function () { if (!onEndFn.done) { onEndFn.done = true; var args = (chainedFLAG || fadeStack.shift()) && fadeStack.shift(); args && fade.apply(this, args); (options.onEnd || noop)(!!args); } }, time = options.time / (chain || 1);
$frames.removeClass(fadeRearClass + ' ' + fadeFrontClass);
$el1 .stop() .addClass(fadeRearClass); $el2 .stop() .addClass(fadeFrontClass);
crossfadeFLAG && _$el2 && $el1.fadeTo(0, 0);
$el1.fadeTo(crossfadeFLAG ? time : 0, 1, crossfadeFLAG && onEndFn); $el2.fadeTo(time, 0, onEndFn);
($el1 && crossfadeFLAG) || $el2 || onEndFn(); } var lastEvent, moveEventType, preventEvent, preventEventTimeout;
function extendEvent (e) { var touch = (e.touches || [])[0] || e; e._x = touch.pageX; e._y = touch.clientY; e._now = $.now(); }
function touch ($el, options) { var el = $el[0], tail = {}, touchEnabledFLAG, startEvent, $target, controlTouch, touchFLAG, targetIsSelectFLAG, targetIsLinkFlag, tolerance, moved;
function onStart (e) { $target = $(e.target); tail.checked = targetIsSelectFLAG = targetIsLinkFlag = moved = false;
if (touchEnabledFLAG
|| tail.flow
|| (e.touches && e.touches.length > 1)
|| e.which > 1
|| (lastEvent && lastEvent.type !== e.type && preventEvent)
|| (targetIsSelectFLAG = options.select && $target.is(options.select, el))) return targetIsSelectFLAG;
touchFLAG = e.type === 'touchstart';
targetIsLinkFlag = $target.is('a, a *', el);
controlTouch = tail.control;
tolerance = (tail.noMove || tail.noSwipe || controlTouch) ? 16 : !tail.snap ? 4 : 0;
extendEvent(e);
startEvent = lastEvent = e;
moveEventType = e.type.replace(/down|start/, 'move').replace(/Down/, 'Move');
(options.onStart || noop).call(el, e, {control: controlTouch, $target: $target});
touchEnabledFLAG = tail.flow = true;
if (!touchFLAG || tail.go) stopEvent(e);
}
function onMove (e) { if ((e.touches && e.touches.length > 1) || (MS_POINTER && !e.isPrimary) || moveEventType !== e.type || !touchEnabledFLAG) { touchEnabledFLAG && onEnd(); (options.onTouchEnd || noop)(); return; }
extendEvent(e);
var xDiff = Math.abs(e._x - startEvent._x), // opt _x → _pageX
yDiff = Math.abs(e._y - startEvent._y),
xyDiff = xDiff - yDiff,
xWin = (tail.go || tail.x || xyDiff >= 0) && !tail.noSwipe,
yWin = xyDiff < 0;
if (touchFLAG && !tail.checked) {
if (touchEnabledFLAG = xWin) {
stopEvent(e);
}
} else {
//console.log('onMove e.preventDefault');
stopEvent(e);
(options.onMove || noop).call(el, e, {touch: touchFLAG});
}
if (!moved && Math.sqrt(Math.pow(xDiff, 2) + Math.pow(yDiff, 2)) > tolerance) {
moved = true;
}
tail.checked = tail.checked || xWin || yWin;
}
function onEnd (e) { ////console.time('touch.js onEnd');
(options.onTouchEnd || noop)();
var _touchEnabledFLAG = touchEnabledFLAG;
tail.control = touchEnabledFLAG = false;
if (_touchEnabledFLAG) {
tail.flow = false;
}
if (!_touchEnabledFLAG || (targetIsLinkFlag && !tail.checked)) return;
e && stopEvent(e);
preventEvent = true;
clearTimeout(preventEventTimeout);
preventEventTimeout = setTimeout(function () {
preventEvent = false;
}, 1000);
(options.onEnd || noop).call(el, {moved: moved, $target: $target, control: controlTouch, touch: touchFLAG, startEvent: startEvent, aborted: !e || e.type === 'MSPointerCancel'});
////console.timeEnd('touch.js onEnd');
}
function onOtherStart () { if (tail.flow) return; setTimeout(function () { tail.flow = true; }, 10); }
function onOtherEnd () { if (!tail.flow) return; setTimeout(function () { tail.flow = false; }, TOUCH_TIMEOUT); }
if (MS_POINTER) { el[ADD_EVENT_LISTENER]('MSPointerDown', onStart, false); document[ADD_EVENT_LISTENER]('MSPointerMove', onMove, false); document[ADD_EVENT_LISTENER]('MSPointerCancel', onEnd, false); document[ADD_EVENT_LISTENER]('MSPointerUp', onEnd, false); } else { if (el[ADD_EVENT_LISTENER]) { el[ADD_EVENT_LISTENER]('touchstart', onStart, false); el[ADD_EVENT_LISTENER]('touchmove', onMove, false); el[ADD_EVENT_LISTENER]('touchend', onEnd, false);
document[ADD_EVENT_LISTENER]('touchstart', onOtherStart, false);
document[ADD_EVENT_LISTENER]('touchend', onOtherEnd, false);
document[ADD_EVENT_LISTENER]('touchcancel', onOtherEnd, false);
window[ADD_EVENT_LISTENER]('scroll', onOtherEnd, false);
}
$el.on('mousedown', onStart);
$DOCUMENT
.on('mousemove', onMove)
.on('mouseup', onEnd);
}
$el.on('click', 'a', function (e) { tail.checked && stopEvent(e); });
return tail; }
function moveOnTouch ($el, options) { var el = $el[0], elData = $el.data(), tail = {}, startCoo, coo, startElPos, moveElPos, edge, moveTrack, startTime, endTime, min, max, snap, slowFLAG, controlFLAG, moved, tracked;
function startTracking (e, noStop) { tracked = true; startCoo = coo = e._x; startTime = e._now;
moveTrack = [
[startTime, startCoo]
];
startElPos = moveElPos = tail.noMove || noStop ? 0 : stop($el, (options.getPos || noop)(), options._001);
(options.onStart || noop).call(el, e);
}
function onStart (e, result) { min = tail.min; max = tail.max; snap = tail.snap;
slowFLAG = e.altKey;
tracked = moved = false;
controlFLAG = result.control;
if (!controlFLAG && !elData.sliding) {
startTracking(e);
}
}
function onMove (e, result) { if (!tail.noSwipe) { if (!tracked) { startTracking(e); }
coo = e._x;
moveTrack.push([e._now, coo]);
moveElPos = startElPos - (startCoo - coo);
edge = findShadowEdge(moveElPos, min, max);
if (moveElPos <= min) {
moveElPos = edgeResistance(moveElPos, min);
} else if (moveElPos >= max) {
moveElPos = edgeResistance(moveElPos, max);
}
if (!tail.noMove) {
$el.css(getTranslate(moveElPos, options._001));
if (!moved) {
moved = true;
// only for mouse
result.touch || MS_POINTER || $el.addClass(grabbingClass);
}
(options.onMove || noop).call(el, e, {pos: moveElPos, edge: edge});
}
}
}
function onEnd (result) { ////console.time('moveontouch.js onEnd'); if (tail.noSwipe && result.moved) return;
if (!tracked) {
startTracking(result.startEvent, true);
}
//console.log('onEnd');
result.touch || MS_POINTER || $el.removeClass(grabbingClass);
endTime = $.now();
var _backTimeIdeal = endTime - TOUCH_TIMEOUT,
_backTime,
_timeDiff,
_timeDiffLast,
backTime = null,
backCoo,
virtualPos,
limitPos,
newPos,
overPos,
time = TRANSITION_DURATION,
speed,
friction = options.friction;
for (var _i = moveTrack.length - 1; _i >= 0; _i--) {
_backTime = moveTrack[_i][0];
_timeDiff = Math.abs(_backTime - _backTimeIdeal);
if (backTime === null || _timeDiff < _timeDiffLast) {
backTime = _backTime;
backCoo = moveTrack[_i][1];
} else if (backTime === _backTimeIdeal || _timeDiff > _timeDiffLast) {
break;
}
_timeDiffLast = _timeDiff;
}
newPos = minMaxLimit(moveElPos, min, max);
var cooDiff = backCoo - coo,
forwardFLAG = cooDiff >= 0,
timeDiff = endTime - backTime,
longTouchFLAG = timeDiff > TOUCH_TIMEOUT,
swipeFLAG = !longTouchFLAG && moveElPos !== startElPos && newPos === moveElPos;
if (snap) {
newPos = minMaxLimit(Math[swipeFLAG ? (forwardFLAG ? 'floor' : 'ceil') : 'round'](moveElPos / snap) * snap, min, max);
min = max = newPos;
}
if (swipeFLAG && (snap || newPos === moveElPos)) {
speed = -(cooDiff / timeDiff);
time *= minMaxLimit(Math.abs(speed), options.timeLow, options.timeHigh);
virtualPos = Math.round(moveElPos + speed * time / friction);
if (!snap) {
newPos = virtualPos;
}
if (!forwardFLAG && virtualPos > max || forwardFLAG && virtualPos < min) {
limitPos = forwardFLAG ? min : max;
overPos = virtualPos - limitPos;
if (!snap) {
newPos = limitPos;
}
overPos = minMaxLimit(newPos + overPos * .03, limitPos - 50, limitPos + 50);
time = Math.abs((moveElPos - overPos) / (speed / friction));
}
}
time *= slowFLAG ? 10 : 1;
(options.onEnd || noop).call(el, $.extend(result, {moved: result.moved || longTouchFLAG && snap, pos: moveElPos, newPos: newPos, overPos: overPos, time: time}));
}
tail = $.extend(touch(options.$wrap, { onStart: onStart, onMove: onMove, onTouchEnd: options.onTouchEnd, onEnd: onEnd, select: options.select }), tail);
return tail; } function wheel ($el, options) { var el = $el[0], lockFLAG, lastDirection, lastNow, tail = { prevent: {} };
el[ADD_EVENT_LISTENER] && el[ADD_EVENT_LISTENER](WHEEL, function (e) { var yDelta = e.wheelDeltaY || -1 * e.deltaY || 0, xDelta = e.wheelDeltaX || -1 * e.deltaX || 0, xWin = Math.abs(xDelta) > Math.abs(yDelta), direction = getDirectionSign(xDelta < 0), sameDirection = lastDirection === direction, now = $.now(), tooFast = now - lastNow < TOUCH_TIMEOUT;
lastDirection = direction;
lastNow = now;
if (!xWin || !tail.ok || tail.prevent[direction] && !lockFLAG) {
return;
} else {
stopEvent(e, true);
if (lockFLAG && sameDirection && tooFast) {
return;
}
}
if (options.shift) {
lockFLAG = true;
clearTimeout(tail.t);
tail.t = setTimeout(function () {
lockFLAG = false;
}, SCROLL_LOCK_TIMEOUT);
}
(options.onEnd || noop)(e, options.shift ? direction : xDelta);
}, false);
return tail; } jQuery.Fotorama = function ($fotorama, opts) { $HTML = $HTML || $('html'); $BODY = $BODY || $('body');
var that = this, stamp = $.now(), stampClass = _fotoramaClass + stamp, fotorama = $fotorama[0], data, dataFrameCount = 1, fotoramaData = $fotorama.data(), size,
$style = $('<style></style>'),
$anchor = $(div(hiddenClass)),
$wrap = $(div(wrapClass)),
$stage = $(div(stageClass)).appendTo($wrap),
stage = $stage[0],
$stageShaft = $(div(stageShaftClass)).appendTo($stage),
$stageFrame = $(),
$arrPrev = $(div(arrClass + ' ' + arrPrevClass/*, div(arrArrClass)*/)),
$arrNext = $(div(arrClass + ' ' + arrNextClass/*, div(arrArrClass)*/)),
$arrs = $arrPrev.add($arrNext).appendTo($stage),
$navWrap = $(div(navWrapClass)),
$nav = $(div(navClass)).appendTo($navWrap),
$navShaft = $(div(navShaftClass)).appendTo($nav),
$navFrame,
$navDotFrame = $(),
$navThumbFrame = $(),
stageShaftData = $stageShaft.data(),
navShaftData = $navShaft.data(),
$thumbBorder = $(div(thumbBorderClass)).appendTo($navShaft),
$fullscreenIcon = $(div(fullscreenIconClass)),
fullscreenIcon = $fullscreenIcon[0],
$videoPlay = $(div(videoPlayClass)),
$videoClose = $(div(videoCloseClass)).appendTo($stage),
videoClose = $videoClose[0],
spinner,
$spinner = $(div(spinnerClass)),
$videoPlaying,
activeIndex = false,
activeFrame,
activeIndexes,
repositionIndex,
dirtyIndex,
lastActiveIndex,
prevIndex,
nextIndex,
startIndex,
o_loop,
o_nav,
o_navThumbs,
o_navTop,
o_allowFullScreen,
o_nativeFullScreen,
o_fade,
o_thumbSide,
o_thumbSide2,
o_transitionDuration,
o_transition,
o_shadows,
o_rtl,
o_keyboard,
lastOptions = {},
measures = {},
measuresSetFLAG,
stageShaftTouchTail = {},
stageWheelTail = {},
navShaftTouchTail = {},
navWheelTail = {},
scrollTop,
scrollLeft,
showedFLAG,
pausedAutoplayFLAG,
stoppedAutoplayFLAG,
toDeactivate = {},
toDetach = {},
measuresStash,
touchedFLAG,
hoverFLAG,
navFrameKey,
stageLeft = 0,
fadeStack = [];
$wrap[STAGE_FRAME_KEY] = $(div(stageFrameClass)); $wrap[NAV_THUMB_FRAME_KEY] = $(div(navFrameClass + ' ' + navFrameThumbClass, div(thumbClass))); $wrap[NAV_DOT_FRAME_KEY] = $(div(navFrameClass + ' ' + navFrameDotClass, div(dotClass)));
toDeactivate[STAGE_FRAME_KEY] = []; toDeactivate[NAV_THUMB_FRAME_KEY] = []; toDeactivate[NAV_DOT_FRAME_KEY] = []; toDetach[STAGE_FRAME_KEY] = {};
$wrap.addClass(CSS3 ? wrapCss3Class : wrapCss2Class);
fotoramaData.fotorama = this;
function checkForVideo () { $.each(data, function (i, dataFrame) { if (!dataFrame.i) { dataFrame.i = dataFrameCount++; var video = findVideoId(dataFrame.video, true); if (video) { var thumbs = {}; dataFrame.video = video; if (!dataFrame.img && !dataFrame.thumb) { thumbs = getVideoThumbs(dataFrame, data, that); } else { dataFrame.thumbsReady = true; } updateData(data, {img: thumbs.img, thumb: thumbs.thumb}, dataFrame.i, that); } } }); }
function allowKey (key) { return o_keyboard[key] || that.fullScreen; }
function bindGlobalEvents (FLAG) { var keydownCommon = 'keydown.' + _fotoramaClass, keydownLocal = 'keydown.' + _fotoramaClass + stamp, resizeLocal = 'resize.' + _fotoramaClass + stamp;
if (FLAG) {
$DOCUMENT
.on(keydownLocal, function (e) {
var catched,
index;
if ($videoPlaying && e.keyCode === 27) {
catched = true;
unloadVideo($videoPlaying, true, true);
} else if (that.fullScreen || (opts.keyboard && !that.index)) {
if (e.keyCode === 27) {
catched = true;
that.cancelFullScreen();
} else if ((e.shiftKey && e.keyCode === 32 && allowKey('space')) || (e.keyCode === 37 && allowKey('left')) || (e.keyCode === 38 && allowKey('up'))) {
index = '<';
} else if ((e.keyCode === 32 && allowKey('space')) || (e.keyCode === 39 && allowKey('right')) || (e.keyCode === 40 && allowKey('down'))) {
index = '>';
} else if (e.keyCode === 36 && allowKey('home')) {
index = '<<';
} else if (e.keyCode === 35 && allowKey('end')) {
index = '>>';
}
}
(catched || index) && stopEvent(e);
index && that.show({index: index, slow: e.altKey, user: true});
});
if (!that.index) {
$DOCUMENT
.off(keydownCommon)
.on(keydownCommon, 'textarea, input, select', function (e) {
!$BODY.hasClass(_fullscreenClass) && e.stopPropagation();
});
}
$WINDOW.on(resizeLocal, that.resize);
} else {
$DOCUMENT.off(keydownLocal);
$WINDOW.off(resizeLocal);
}
}
function appendElements (FLAG) { if (FLAG === appendElements.f) return;
if (FLAG) {
$fotorama
.html('')
.addClass(_fotoramaClass + ' ' + stampClass)
.append($wrap)
.before($style)
.before($anchor);
addInstance(that);
} else {
$wrap.detach();
$style.detach();
$anchor.detach();
$fotorama
.html(fotoramaData.urtext)
.removeClass(stampClass);
hideInstance(that);
}
bindGlobalEvents(FLAG);
appendElements.f = FLAG;
}
function setData () { data = that.data = data || clone(opts.data) || getDataFromHtml($fotorama); size = that.size = data.length;
!ready.ok && opts.shuffle && shuffle(data);
checkForVideo();
activeIndex = limitIndex(activeIndex);
size && appendElements(true);
}
function stageNoMove () { var _noMove = size < 2 || $videoPlaying; stageShaftTouchTail.noMove = _noMove || o_fade; stageShaftTouchTail.noSwipe = _noMove || !opts.swipe;
!o_transition && $stageShaft.toggleClass(grabClass, !stageShaftTouchTail.noMove && !stageShaftTouchTail.noSwipe);
MS_POINTER && $wrap.toggleClass(wrapPanYClass, !stageShaftTouchTail.noSwipe);
}
function setAutoplayInterval (interval) { if (interval === true) interval = ''; opts.autoplay = Math.max(+interval || AUTOPLAY_INTERVAL, o_transitionDuration * 1.5); }
/**
*/ function setOptions () { that.options = opts = optionsToLowerCase(opts);
o_fade = (opts.transition === 'crossfade' || opts.transition === 'dissolve');
o_loop = opts.loop && (size > 2 || o_fade) && (!o_transition || o_transition !== 'slide');
o_transitionDuration = +opts.transitionduration || TRANSITION_DURATION;
o_rtl = opts.direction === 'rtl';
o_keyboard = $.extend({}, opts.keyboard && KEYBOARD_OPTIONS, opts.keyboard);
var classes = {add: [], remove: []};
function addOrRemoveClass (FLAG, value) { classes[FLAG ? 'add' : 'remove'].push(value); }
if (size > 1) { o_nav = opts.nav; o_navTop = opts.navposition === 'top'; classes.remove.push(selectClass);
$arrs.toggle(!!opts.arrows);
} else { o_nav = false; $arrs.hide(); }
spinnerStop(); spinner = new Spinner($.extend(spinnerDefaults, opts.spinner, spinnerOverride, {direction: o_rtl ? -1 : 1}));
arrsUpdate(); stageWheelUpdate();
if (opts.autoplay) setAutoplayInterval(opts.autoplay);
o_thumbSide = numberFromMeasure(opts.thumbwidth) || THUMB_SIZE; o_thumbSide2 = numberFromMeasure(opts.thumbheight) || THUMB_SIZE;
stageWheelTail.ok = navWheelTail.ok = opts.trackpad && !SLOW;
stageNoMove();
extendMeasures(opts, [measures]);
o_navThumbs = o_nav === 'thumbs';
if (o_navThumbs) { frameDraw(size, 'navThumb');
$navFrame = $navThumbFrame;
navFrameKey = NAV_THUMB_FRAME_KEY;
setStyle($style, $.Fotorama.jst.style({w: o_thumbSide, h: o_thumbSide2, b: opts.thumbborderwidth, m: opts.thumbmargin, s: stamp, q: !COMPAT}));
$nav
.addClass(navThumbsClass)
.removeClass(navDotsClass);
} else if (o_nav === 'dots') { frameDraw(size, 'navDot');
$navFrame = $navDotFrame;
navFrameKey = NAV_DOT_FRAME_KEY;
$nav
.addClass(navDotsClass)
.removeClass(navThumbsClass);
} else { o_nav = false; $nav.removeClass(navThumbsClass + ' ' + navDotsClass); }
if (o_nav) { if (o_navTop) { $navWrap.insertBefore($stage); } else { $navWrap.insertAfter($stage); }
frameAppend.nav = false;
frameAppend($navFrame, $navShaft, 'nav');
}
o_allowFullScreen = opts.allowfullscreen;
if (o_allowFullScreen) { $fullscreenIcon.appendTo($stage); o_nativeFullScreen = FULLSCREEN && o_allowFullScreen === 'native'; } else { $fullscreenIcon.detach(); o_nativeFullScreen = false; }
addOrRemoveClass(o_fade, wrapFadeClass); addOrRemoveClass(!o_fade, wrapSlideClass); addOrRemoveClass(!opts.captions, wrapNoCaptionsClass); /* attempting to add the gallery titles components */ addOrRemoveClass(!opts.titles, wrapNoTitlesClass); addOrRemoveClass(o_rtl, wrapRtlClass); addOrRemoveClass(opts.arrows !== 'always', wrapToggleArrowsClass);
o_shadows = opts.shadows && !SLOW; addOrRemoveClass(!o_shadows, wrapNoShadowsClass);
$wrap .addClass(classes.add.join(' ')) .removeClass(classes.remove.join(' '));
lastOptions = $.extend({}, opts); }
function normalizeIndex (index) { return index < 0 ? (size + (index % size)) % size : index >= size ? index % size : index; }
function limitIndex (index) { return minMaxLimit(index, 0, size - 1); }
function edgeIndex (index) { return o_loop ? normalizeIndex(index) : limitIndex(index); }
function getPrevIndex (index) { return index > 0 || o_loop ? index - 1 : false; }
function getNextIndex (index) { return index < size - 1 || o_loop ? index + 1 : false; }
function setStageShaftMinmaxAndSnap () { stageShaftTouchTail.min = o_loop ? -Infinity : -getPosByIndex(size - 1, measures.w, opts.margin, repositionIndex); stageShaftTouchTail.max = o_loop ? Infinity : -getPosByIndex(0, measures.w, opts.margin, repositionIndex); stageShaftTouchTail.snap = measures.w + opts.margin; }
function setNavShaftMinMax () { ////console.log('setNavShaftMinMax', measures.nw); navShaftTouchTail.min = Math.min(0, measures.nw - $navShaft.width()); navShaftTouchTail.max = 0; $navShaft.toggleClass(grabClass, !(navShaftTouchTail.noMove = navShaftTouchTail.min === navShaftTouchTail.max)); }
function eachIndex (indexes, type, fn) { if (typeof indexes === 'number') { indexes = new Array(indexes); var rangeFLAG = true; } return $.each(indexes, function (i, index) { if (rangeFLAG) index = i; if (typeof index === 'number') { var dataFrame = data[normalizeIndex(index)];
if (dataFrame) {
var key = '$' + type + 'Frame',
$frame = dataFrame[key];
fn.call(this, i, index, dataFrame, $frame, key, $frame && $frame.data());
}
}
@yhwhdesign
how to change the number that is added to the ‘element.style’ tag that controls the ‘left’ tag of previous and next images you can take a look at https://github.com/artpolikarpov/fotorama/issues/208#issuecomment-38338738 on howto hide/show the captions. Just add another element (either via javascript or html) and style it via css, like the close/arrow buttons, to give it an icon.
how to change the number that is added to the ‘element.style’ tag t No idea, what you mean. how to add a new div container underneath the container that holds the thumbnails like this: http://fotorama.io/customize/html/ just apply position: absolute and the position you want to the element with css.
- Final.. Is there a way to add in the option to buy an image, like the one that is active? Same as above, just add an html anchor or button an style it.
Thank you again. for your time. I hope that I do not have to ask you questions again.
I am almost willing to send you a graphical mock up of what I am needing and seeing how much you would charge to do it so it is done right.
My javascript knowledge isn’t very good especially when trying to add elements dynamically, and using javascript to create movement. Im trying to learn, but jumping into a project like this and trying to add elements and customize a real professionals work, lol… I have a tough road ahead.
Again, I thank you for your time, it is very valuable to me! Jasen
On Apr 8, 2014, at 5:49 PM, Ferhat notifications@github.com wrote:
@yhwhdesign
how to change the number that is added to the ‘element.style’ tag that controls the ‘left’ tag of previous and next images you can take a look at #208 (comment) on howto hide/show the captions. Just add another element (either via javascript or html) and style it via css, like the close/arrow buttons, to give it an icon.
how to change the number that is added to the ‘element.style’ tag t No idea, what you mean. how to add a new div container underneath the container that holds the thumbnails like this: http://fotorama.io/customize/html/ just apply position: absolute and the position you want to the element with css.
Final.. Is there a way to add in the option to buy an image, like the one that is active? Same as above, just add an html anchor or button an style it. — Reply to this email directly or view it on GitHub.
The element left issue on the previous and next images…
using firefox / chrome you can inspect the elements and when you do this, you find that in the div tag or in the code for the previous and next images it shows some css tags, but then there is an added in ‘style’ tag where the code ‘left: -1000px;’ is added for the previous image, if I change this to something like -885px and the next image repeats this except it is a positive number…s o I would change it to something like ‘895px’ and it brings those images into view and puts them right next to the active centered image with about 5px gap between the two.
This style tag is not found obviously in the css file.. it is being added via javascript and the numbers given to the ‘left’ tag is also javascript and it is going off of the width of the stage thus giving you a number to push it out of view of the stage. I think.
Anyway, I will go through the code and info you sent…thank you again! I hope that I can get this figured out so I do not have to bother you anymore… the help is priceless!!
On Apr 8, 2014, at 5:49 PM, Ferhat notifications@github.com wrote:
@yhwhdesign
how to change the number that is added to the ‘element.style’ tag that controls the ‘left’ tag of previous and next images you can take a look at #208 (comment) on howto hide/show the captions. Just add another element (either via javascript or html) and style it via css, like the close/arrow buttons, to give it an icon.
how to change the number that is added to the ‘element.style’ tag t No idea, what you mean. how to add a new div container underneath the container that holds the thumbnails like this: http://fotorama.io/customize/html/ just apply position: absolute and the position you want to the element with css.
Final.. Is there a way to add in the option to buy an image, like the one that is active? Same as above, just add an html anchor or button an style it. — Reply to this email directly or view it on GitHub.
Captions are not correctly hidden if Fotorama is issued to hide captions later on in its life-cycle. See the following JsFiddle:
http://jsfiddle.net/6uw5b/1/
It will only hide the captions of the slides that one has not yet seen. In the Fiddle you see that the captions remain visible for the first two slides. I tried to fix this behaviour but failed to do so.