/* * - Add VC_Row classes [with - support theme] * - Add Active Menu class *-------------------------------------------------------------*/ ;(function ( $, window, undefined ) { var pluginName = 'OPN_Scroll', document = window.document, defaults = { vc_version: parseFloat('4.7'), activeItem: 'opn_active_menu', rowClass: 'vc_row', active: '', firstItem: false, };
function opn( element, options ) { this.element = element; this.options = $.extend( {}, defaults, options) ; this._defaults = defaults; this._name = pluginName; this.init(); } opn.prototype.init = function () { var self = this; var p = self._defaults; var ac = p.activeItem;
// Add active class $('a[href*=#]:not([href=#])').bind('click touchstart', function(){ $(this).parent('li').siblings().removeClass( ac ); $(this).parent('li').addClass( ac ); });
if(typeof p.rowClass != 'undefined' && p.rowClass != null) {
// Add THEME Support for VC ROW ID from OPN $('.opn-row-pre-element').each(function(index, el) { var id = $(el).attr('data-id'); var gutter = $(el).attr('data-gutter'); var opn_enable_overlay = $(el).attr('data-opn_enable_overlay') || ''; var opn_hide_navigation = $(el).attr('data-opn_hide_navigation') || '';
// set VC row class from user var $row = $(el).prevAll('.'+p.rowClass+':first');
$row.attr('data-op-gutter', gutter); $row.attr('data-opn_enable_overlay', opn_enable_overlay); $row.attr('data-opn_hide_navigation', opn_hide_navigation); if (id != '') { // Add ID for VC version <= 4.4 /*if( parseFloat(p.vc_version) <= parseFloat(4.4) ) {*/ // Check VC version 4.5 set ROW ID // if not found set OPN ID for row. /* Does not check VC version or Row has ID. * Add ID for row Either VC or OPN. * To fix theme ID's issue. *------------------------------------------------------------*/ var hasID = $row.attr('id') || ''; if(hasID === 'undefined' || hasID === null || hasID==='') { $row.attr('id', id); } /*}*/ } $(el).remove(); }); // Apply for 1 Scroll setTimeout(function(){ $('.'+p.rowClass).each( function(index, elem) { var id = $(elem).attr('id') || null; if(typeof id!= 'undefined' && id != null) { // Get fist Item if( p.firstItem == false ) { p.firstItem = id; $('#'+p.firstItem).addClass('opn-active'); $('#'+p.firstItem).parent().addClass('opn-row-container'); } } }); },700); } }; $.fn[pluginName] = function ( options ) { return this.each(function () { if (!$.data(this, 'plugin_' + pluginName)) { $.data(this, 'plugin_' + pluginName, new opn( this, options )); } }); } $(document).ready(function() { $('body').OPN_Scroll(); // on Visit Scroll to # link var opn_jump = function(e) { var target = 'undefined'; if (e) { e.preventDefault(); if( !$(this).hasClass('.ui-tabs-anchor, .vc_tta-panel-title a, .vc_tta-tab a, .ult_tab_li a, .portfolio-tabs li a, a.scrollup') ) { target = $(this).attr("href"); } } else { target = location.hash; } if (typeof target === 'undefined' || target === '') return false; var gutter = $(target).attr('data-op-gutter'); if (typeof gutter === 'undefined') gutter = 0; $(target).animatescroll({ scrollSpeed: 1000, easing: 'easeOutQuad', padding: gutter }); location.hash = target; $(window).load(function(){ setTimeout(function(){ $(target).animatescroll({ scrollSpeed: 1000, easing: 'easeOutQuad', padding: gutter }); },500); }); } opn_jump(); // Add EXCLUDE - Classes & ID's $('.ui-tabs-anchor, .vc_tta-panel-title a, .vc_tta-tab a, .ult_tab_li a, .portfolio-tabs li a, a.scrollup').addClass('opn-exclude'); /* * on Click / Touch *--------------------------------------------------------*/ // For menu it will works $("a[href*=#]:not('.opn-exclude')").bind('click touchstart', function(){ if (location.pathname.replace(//$/, '') == this.pathname.replace(//$/, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { var id = this.hash.slice(1); var gutter = $('#' + id).attr('data-op-gutter') || 0; $('#' + id).animatescroll({ scrollSpeed: 1000, easing: "easeOutQuad", padding: gutter }); return false; } } }); }); $(document).on('click touchstart', "a[href*=#]:not('.opn-exclude')", function(e) { //$(document).on('click touchstart', 'a[href*=#]:not([href=#]), a[href*=#]:not(".ui-tabs-anchor, .vc_tta-panel-title a, .vc_tta-tab a, .ult_tab_li a, .portfolio-tabs li a, a.scrollup")', function(e) { if (location.pathname.replace(//$/, '') == this.pathname.replace(//$/, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { var scroll_speed = 1000; var scroll_effect = "easeOutQuad"; var id = this.hash.slice(1); // Above settings works JUST for - One Page Navigator - Menu var i = p = ''; $('.opn_fixed .opn_list').each(function(index, element) { var anch = $(element).find('a'); anch.each(function(ind, elm) { var a = $(elm).attr('href'); if(typeof a !== 'undefined' && a != null) { ind = a.split('#')[1]; if(id == ind) { p = $(elm).parent().parent(); scroll_speed = p.attr('data-scroll_speed') || 1000; scroll_effect = p.attr('data-scroll_effect') || "easeOutQuad"; } } }); }); var gutter = $('#' + id).attr('data-op-gutter') || 0; scroll_speed = parseInt(scroll_speed); $('#' + id).animatescroll({ scrollSpeed: scroll_speed, easing: scroll_effect, padding: gutter }); return false; } } }); }(jQuery, window));
The DOM Family is proud to share the successful launch of the Évolur range of baby products with you! Our attendance and launch of the Évolur brand at The ABC Kids Expo. held at the Las Vegas Convention Center this October, between 18th and 21st was a huge success. Our products were[...]
The post Évolur launched successfully at the ABC Show in Las Vegas! appeared first on The DOM Family.