Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slidesjs.update = function (element, position) {
- element.each(function () {
- var $this = $(this);
- var defaults;
- // http://www.levihackwith.com/element-dataset-not-supported-in-ie-heres-a-workaround/
- //if ($this[0].dataset === undefined) {
- defaults = $this[0].getAttribute('data-defaults');
- //} else if ($this[0].dataset.hasOwnProperty('defaults')) {
- // defaults = $this.data('defaults');
- //}
- if (defaults) {
- if (defaults.options.aspect.rect) {
- $this.height(project.utility.getRatio.calc16x9($this.width()));
- } else if (defaults.options.aspect.sqr) {
- $this.height(project.utility.getRatio.calc4x3($this.width()));
- } else if (defaults.options.columns) {
- $this.height(Math.floor($this.width() / defaults.options.columns));
- }
- }
- if ($('.slidesjs-navigation', this).length) {
- var nav = $('.slidesjs-navigation', this);
- if (nav.is(':visible')) {
- var pos = Math.floor($this.height() / 2) - Math.floor(nav.height() / 2);
- if (!position) {
- nav.css('top', pos);
- } else {
- nav.css('top', position);
- }
- }
- }
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement