Автор Тема: Скрыть выпадающее меню  (Прочитано 2422 раз)

05 Июнь 2015, 12:40:49
Ответ #15
  • Ветеран
  • *****
  • Сообщений: 1285
  • Репутация: +13/-1
  • Сообщество PrestaShop
    • Просмотр профиля
Меню и модуль новых товаров не связанны. Проблема может возникнутьь только если вы допустили ошибку в js файле. При ошибке js файл не загружается. Отследить ошибку можно с помощью firebug.
05 Июнь 2015, 22:51:47
Ответ #16
  • Новичок
  • *
  • Сообщений: 23
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Ошибку тут показывает.
Линия 60

$menu.hoverIntent(over, out, targets);
06 Июнь 2015, 10:47:32
Ответ #17
  • Ветеран
  • *****
  • Сообщений: 1614
  • Репутация: +32/-1
  • Сообщество PrestaShop
    • Просмотр профиля
Закоментируйте эту строку.
08 Июнь 2015, 17:50:24
Ответ #18
  • Новичок
  • *
  • Сообщений: 23
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Ну не знаю не получается. Меню не выскакивает и новые потепление не выскакивают сами
08 Июнь 2015, 17:56:12
Ответ #19
  • Модератор
  • Ветеран
  • *****
  • Сообщений: 86688
  • Репутация: +25428/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Приложите архив модуля с вашими изменениями.
10 Июнь 2015, 17:43:13
Ответ #20
  • Новичок
  • *
  • Сообщений: 23
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Менял тока в js скрипте /themes/default-bootstrap/js/modules/blocktopmenu/js/superfish-modified.js

Вот этот весь код.

/*
 * jQuery Superfish Menu Plugin - v1.7.4
 * Copyright (c) 2013 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */

(function ($) {
"use strict";

var methods = (function () {
// private properties and methods go here
var c = {
bcClass: 'sf-breadcrumb',
menuClass: 'sf-js-enabled',
anchorClass: 'sf-with-ul',
menuArrowClass: 'sf-arrows'
},
ios = (function () {
var ios = /iPhone|iPad|iPod/i.test(navigator.userAgent);
if (ios) {
// iOS clicks only bubble as far as body children
$(window).load(function () {
$('body').children().on('click', $.noop);
});
}
return ios;
})(),
wp7 = (function () {
var style = document.documentElement.style;
return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent));
})(),
toggleMenuClasses = function ($menu, o) {
var classes = c.menuClass;
if (o.cssArrows) {
classes += ' ' + c.menuArrowClass;
}
$menu.toggleClass(classes);
},
setPathToCurrent = function ($menu, o) {
return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels)
.addClass(o.hoverClass + ' ' + c.bcClass)
.filter(function () {
return ($(this).children(o.popUpSelector).hide().show().length);
}).removeClass(o.pathClass);
},
toggleAnchorClass = function ($li) {
$li.children('a').toggleClass(c.anchorClass);
},
toggleTouchAction = function ($menu) {
var touchAction = $menu.css('ms-touch-action');
touchAction = (touchAction === 'pan-y') ? 'auto' : 'pan-y';
$menu.css('ms-touch-action', touchAction);
},
applyHandlers = function ($menu, o) {
var targets = 'li:has(' + o.popUpSelector + ')';
if ($.fn.hoverIntent && !o.disableHI) {
$menu.hoverIntent(over, out, targets);
}
else {
$menu
.on('mouseenter.superfish', targets, over)
.on('mouseleave.superfish', targets, out);
}
var touchevent = 'MSPointerDown.superfish';
if (!ios) {
touchevent += ' touchend.superfish';
}
if (wp7) {
touchevent += ' mousedown.superfish';
}
$menu
.on('focusin.superfish', 'li', over)
.on('focusout.superfish', 'li', out)
.on(touchevent, 'a', o, touchHandler);
},
touchHandler = function (e) {
var $this = $(this),
$ul = $this.siblings(e.data.popUpSelector);

if ($ul.length > 0 && $ul.is(':hidden')) {
$this.one('click.superfish', false);
if (e.type === 'MSPointerDown') {
$this.trigger('focus');
} else {
$.proxy(over, $this.parent('li'))();
}
}
},
                        /*
over = function () {
var $this = $(this),
o = getOptions($this);
clearTimeout(o.sfTimer);
$this.siblings().superfish('hide').end().superfish('show');
},
out = function () {
var $this = $(this),
o = getOptions($this);
if (ios) {
$.proxy(close, $this, o)();
}
else {
clearTimeout(o.sfTimer);
o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay);
}
},

                        */
close = function (o) {
o.retainPath = ($.inArray(this[0], o.$path) > -1);
this.superfish('hide');

if (!this.parents('.' + o.hoverClass).length) {
o.onIdle.call(getMenu(this));
if (o.$path.length) {
$.proxy(over, o.$path)();
}
}
},
getMenu = function ($el) {
return $el.closest('.' + c.menuClass);
},
getOptions = function ($el) {
return getMenu($el).data('sf-options');
};

return {
// public methods
hide: function (instant) {
if (this.length) {
var $this = this,
o = getOptions($this);
if (!o) {
return this;
}
var not = (o.retainPath === true) ? o.$path : '',
$ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector),
speed = o.speedOut;

if (instant) {
$ul.show();
speed = 0;
}
o.retainPath = false;
o.onBeforeHide.call($ul);
$ul.stop(true, true).animate(o.animationOut, speed, function () {
var $this = $(this);
o.onHide.call($this);
});
}
return this;
},
show: function () {
var o = getOptions(this);
if (!o) {
return this;
}
var $this = this.addClass(o.hoverClass),
$ul = $this.children(o.popUpSelector);

o.onBeforeShow.call($ul);
$ul.stop(true, true).animate(o.animation, o.speed, function () {
o.onShow.call($ul);
});
return this;
},
destroy: function () {
return this.each(function () {
var $this = $(this),
o = $this.data('sf-options'),
$hasPopUp;
if (!o) {
return false;
}
$hasPopUp = $this.find(o.popUpSelector).parent('li');
clearTimeout(o.sfTimer);
toggleMenuClasses($this, o);
toggleAnchorClass($hasPopUp);
toggleTouchAction($this);
// remove event handlers
$this.off('.superfish').off('.hoverIntent');
// clear animation's inline display style
$hasPopUp.children(o.popUpSelector).attr('style', function (i, style) {
return style.replace(/display[^;]+;?/g, '');
});
// reset 'current' path classes
o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass);
$this.find('.' + o.hoverClass).removeClass(o.hoverClass);
o.onDestroy.call($this);
$this.removeData('sf-options');
});
},
init: function (op) {
return this.each(function () {
var $this = $(this);
if ($this.data('sf-options')) {
return false;
}
var o = $.extend({}, $.fn.superfish.defaults, op),
$hasPopUp = $this.find(o.popUpSelector).parent('li');
o.$path = setPathToCurrent($this, o);

$this.data('sf-options', o);

toggleMenuClasses($this, o);
toggleAnchorClass($hasPopUp);
toggleTouchAction($this);
applyHandlers($this, o);

$hasPopUp.not('.' + c.bcClass).superfish('hide', true);

o.onInit.call(this);
});
}
};
})();

$.fn.superfish = function (method, args) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}
else if (typeof method === 'object' || ! method) {
return methods.init.apply(this, arguments);
}
else {
return $.error('Method ' +  method + ' does not exist on jQuery.fn.superfish');
}
};

$.fn.superfish.defaults = {
popUpSelector: 'ul,.sf-mega', // within menu context
hoverClass: 'sfHover',
pathClass: 'overrideThisToUse',
pathLevels: 0,
delay: 800,
animation: {opacity: 'show'},
animationOut: {opacity: 'hide'},
speed: 'normal',
speedOut: 'fast',
cssArrows: true,
disableHI: false,
onInit: $.noop,
onBeforeShow: $.noop,
onShow: $.noop,
onBeforeHide: $.noop,
onHide: $.noop,
onIdle: $.noop,
onDestroy: $.noop
};

// soon to be deprecated
$.fn.extend({
hideSuperfishUl: methods.hide,
showSuperfishUl: methods.show
});

})(jQuery);
10 Июнь 2015, 18:00:47
Ответ #21
  • Ветеран
  • *****
  • Сообщений: 22125
  • Репутация: +25303/-1
  • Prestashop - просто и эффективно
    • Просмотр профиля
Попробывал ваш файл, ничего больше не менял, меню не выпадает.
Эксперт Prestashop - решения всех проблем, написание модулей, создание тем для интернет-магазинов под Prestashop.
Эксперт Magento - создам сайт на Magento, программирование кастомных модулей для Magento, кастомизация тем Magento.
Лучшие цены!!!
10 Июнь 2015, 18:05:26
Ответ #22
  • Новичок
  • *
  • Сообщений: 23
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Да оно не выпадает, но теперь у меня товар не появляется сразу Новые поступление.
Раньше как заходил на сайт сразу показывался товар с Новые поступление а теперь надо нажимать на кнопку новые поступление и тогда они ток выскакивают.
10 Июнь 2015, 18:54:28
Ответ #23
  • Ветеран
  • *****
  • Сообщений: 16670
  • Репутация: +14630/-5
  • Сообщество PrestaShop
    • Просмотр профиля
Нужно все over/out убрать из текста. Если закоментировали эти функции, то обращение  к ним вызывает ошибку. Js перестает загружать и товары не показывает.
10 Июнь 2015, 18:56:18
Ответ #24
  • Ветеран
  • *****
  • Сообщений: 22125
  • Репутация: +25303/-1
  • Prestashop - просто и эффективно
    • Просмотр профиля
В каком браузере смотрели?
Эксперт Prestashop - решения всех проблем, написание модулей, создание тем для интернет-магазинов под Prestashop.
Эксперт Magento - создам сайт на Magento, программирование кастомных модулей для Magento, кастомизация тем Magento.
Лучшие цены!!!
10 Июнь 2015, 22:17:26
Ответ #25
  • Модератор
  • Ветеран
  • *****
  • Сообщений: 105673
  • Репутация: +39553/-0
    • Просмотр профиля
    • Webstudio UwK
Не получается через js, попробуйте через стили.
Верните оригинальный файл  /themes/default-bootstrap/js/modules/blocktopmenu/js/superfish-modified.js
В файле стиле /themes/default-bootstrap/css/modules/blocktopmenu/css/superfish-modified.css добавьте
sf-menu ul.submenu-container{visibility: hidden !important;}
Cоздание интернет сайтов Webstudio UwK
11 Июнь 2015, 10:32:22
Ответ #26
  • Новичок
  • *
  • Сообщений: 23
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Не получается через js, попробуйте через стили.
Верните оригинальный файл  /themes/default-bootstrap/js/modules/blocktopmenu/js/superfish-modified.js
В файле стиле /themes/default-bootstrap/css/modules/blocktopmenu/css/superfish-modified.css добавьте
sf-menu ul.submenu-container{visibility: hidden !important;}

Сделал как вы сказали, меню выпадает.
11 Июнь 2015, 10:41:19
Ответ #27
  • Фрилансер
  • *
  • Сообщений: 113
  • Репутация: +3/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Может быть вы используете свою тему, своии стили и javascript?
Оба варианта работают. На оф. сайте
https://plugins.jquery.com/superfish/
http://users.tpg.com.au/j_birch/plugins/superfish/options/
советывают регулировать показ уровней переменной pathLevels:1,2...
Но и со стилями вариант работает.
Напишите адрес сайта.
 
11 Июнь 2015, 10:46:12
Ответ #28
  • Новичок
  • *
  • Сообщений: 23
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
http://e-smoke.lv/

Там оригинальный шаблон стоит, js когда меняешь тогда меню не вылетает но и товар не выскакивает а это уже не хорошо
11 Июнь 2015, 11:20:51
Ответ #29
  • Ветеран
  • *****
  • Сообщений: 1285
  • Репутация: +13/-1
  • Сообщество PrestaShop
    • Просмотр профиля
Когда добавили новые правла стилей проверили сайт, они загрузились, шаблон поменялся?
Сайт на обслуживании и ничего не видно.