Add mobile styling
This commit is contained in:
97
public/js/functions.js
vendored
97
public/js/functions.js
vendored
@@ -80,29 +80,57 @@ $(function () {
|
||||
var submenu = $('<div style="width: ' + $menuItem.outerWidth() + 'px"><a href="' + $menuItem.find('a').attr('href') + '" style="width: ' + $menuItem.outerWidth() + 'px"></a></div>').append($menuItem.children('ul.submenu').clone());
|
||||
var pos = $menuItem.offset();
|
||||
submenu.addClass('menu-submenu').css({top: pos.top, left: pos.left});
|
||||
submenu.on( "mouseleave", function(){
|
||||
submenu.on( "mouseleave", function() {
|
||||
$('.menu-submenu > ul.submenu').slideUp(400, function(){$(this).closest('.menu-submenu').remove()});
|
||||
$menuItem.removeClass('hover');
|
||||
} );
|
||||
$('body').append(submenu);
|
||||
submenu.children('ul.submenu').slideDown();
|
||||
|
||||
submenu.find('ul.submenu li.has_submenu').click(function(){
|
||||
$(this).find('ul.submenu').slideToggle();
|
||||
$(this).toggleClass('opened');
|
||||
});
|
||||
submenu.find('ul.submenu').subMenu({});
|
||||
openPlayerInNewScreen();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {object} _options
|
||||
*/
|
||||
$.fn.subMenu = function (_options) {
|
||||
var options = {
|
||||
menuSubmenuClass: 'has_submenu'
|
||||
};
|
||||
$.extend(options, _options);
|
||||
var $container = $(this);
|
||||
|
||||
$container.find('li.' + options.menuSubmenuClass + ' > a').click(function(e) {
|
||||
e.preventDefault();
|
||||
var $li = $(this).closest('li');
|
||||
$li.children('ul.submenu').slideToggle();
|
||||
$li.toggleClass('opened');
|
||||
});
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
|
||||
$(function () {
|
||||
$('.menu, .mobile-menu').menu({});
|
||||
$('.menu').menu({});
|
||||
$('.mobile-menu').subMenu({});
|
||||
$('.mobile_menu_button a').click(function() {
|
||||
$('.mobile_menu_container').show();
|
||||
});
|
||||
$('.mobile_close_menu_button a').click(function() {
|
||||
$('.mobile_menu_container').hide();
|
||||
});
|
||||
$('.mobile_menu_container').click(function(e){
|
||||
var $target = $(e.target);
|
||||
if(!$target.closest('#mobile_menu_nav').length &&
|
||||
$('.mobile_menu_container').is(":visible")) {
|
||||
$('.mobile_menu_container').hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
console.log($(".prettyPhoto[rel^='prettyPhoto']"));
|
||||
$(".prettyPhoto[rel^='prettyPhoto']").prettyPhoto({
|
||||
show_title: false,
|
||||
slideshow: 3000,
|
||||
@@ -111,6 +139,61 @@ $(function () {
|
||||
});
|
||||
});
|
||||
|
||||
(function ($) {
|
||||
|
||||
/**
|
||||
* @param {object} _options
|
||||
*/
|
||||
$.fn.snapTo = function (_options) {
|
||||
var options = {
|
||||
elementClass: 'post'
|
||||
};
|
||||
$.extend(options, _options);
|
||||
var $container = $(this);
|
||||
var $elements = $container.find('.' + options.elementClass + ':visible');
|
||||
var stopSnapTo = false;
|
||||
|
||||
var snapTimeout = null;
|
||||
var snapHandler = function() {
|
||||
if (!stopSnapTo) {
|
||||
stopSnapTo = true;
|
||||
var y = $container.scrollLeft();
|
||||
$elements.each(function () {
|
||||
var offset = $(this).offset();
|
||||
if (offset.left > -(window.screen.width / 2) && offset.left < window.screen.width / 2) {
|
||||
$container.animate({
|
||||
scrollLeft: Math.round(y + offset.left) + 'px'
|
||||
}, 300);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (snapTimeout) {
|
||||
clearTimeout(snapTimeout);
|
||||
}
|
||||
snapTimeout = setTimeout(function () {
|
||||
stopSnapTo = false;
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
var snapToHandlerTimer = null;
|
||||
var scrollHandler = function() {
|
||||
if (snapToHandlerTimer) {
|
||||
clearTimeout(snapToHandlerTimer);
|
||||
}
|
||||
snapToHandlerTimer = setTimeout(snapHandler, 300);
|
||||
};
|
||||
|
||||
$container.on( "scroll", scrollHandler);
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
|
||||
$(function () {
|
||||
$('[data-snapto]').each(function () {
|
||||
$(this).snapTo($(this).data('snapto'));
|
||||
});
|
||||
});
|
||||
|
||||
(function ($) {
|
||||
|
||||
/**
|
||||
|
||||
4
public/js/functions.min.js
vendored
4
public/js/functions.min.js
vendored
@@ -1,2 +1,2 @@
|
||||
/*! 2024-03-18 */
|
||||
!function(l){l.fn.loadMoreNews=function(e){var a=2,n=!1,i={loadingElementId:"#loading",container:"",url:document.location.pathname},o=(l.extend(i,e),l(i.loadingElementId,this));o.hide(),this.click(function(e){var t,s;e.preventDefault(),n||(n=1,o.show(),t=l(this).attr("disabled","disabled"),s=l(i.container),l.ajax({url:i.url+(0<=i.url.indexOf("?")?"&":"?")+"pagina="+a}).always(function(){n=0,o.hide(),t.removeAttr("disabled")}).done(function(n){n?(s.each(function(){var e=this.toString();l(e).append(l("<div>"+n+"</div>").find(e).length?l("<div>"+n+"</div>").find(e).children():l(n))}),++a):t.attr("disabled","disabled").text("Geen nieuws meer.")}))})}}(jQuery),$(function(){$("[data-loadmorenews]").each(function(){$(this).loadMoreNews($(this).data("loadmorenews"))})}),function(a){a.fn.menu=function(e){var n={menuSubmenuClass:"has_submenu"},e=(a.extend(n,e),a(this).children("."+n.menuSubmenuClass)),s=a(this);e.on("mouseenter",function(){var e=a(this),n=(a(".menu-submenu > ul.submenu").slideUp(400,function(){a(this).closest(".menu-submenu").remove()}),a(".hover",s).removeClass("hover"),e.addClass("hover"),a('<div style="width: '+e.outerWidth()+'px"><a href="'+e.find("a").attr("href")+'" style="width: '+e.outerWidth()+'px"></a></div>').append(e.children("ul.submenu").clone())),t=e.offset();n.addClass("menu-submenu").css({top:t.top,left:t.left}),n.on("mouseleave",function(){a(".menu-submenu > ul.submenu").slideUp(400,function(){a(this).closest(".menu-submenu").remove()}),e.removeClass("hover")}),a("body").append(n),n.children("ul.submenu").slideDown(),n.find("ul.submenu li.has_submenu").click(function(){a(this).find("ul.submenu").slideToggle(),a(this).toggleClass("opened")}),openPlayerInNewScreen()})}}(jQuery),$(function(){$(".menu, .mobile-menu").menu({})}),$(function(){console.log($(".prettyPhoto[rel^='prettyPhoto']")),$(".prettyPhoto[rel^='prettyPhoto']").prettyPhoto({show_title:!1,slideshow:3e3,overlay_gallery:!0,social_tools:""})}),function(a){a.fn.tabs=function(e){var n={tabClass:"box_header",activeClass:"active",contentClass:"tab_content"},t=(a.extend(n,e),a(this).find("."+n.tabClass)),s=a(this);t.click(function(e){e.preventDefault(),t.removeClass(n.activeClass),s.find("."+n.contentClass).removeClass(n.activeClass),s.find("#"+a(this).data("tab-content-id")).addClass(n.activeClass),a(this).addClass(n.activeClass)})}}(jQuery),$(function(){$("[data-tabs]").each(function(){$(this).tabs($(this).data("tabs")??{})})});
|
||||
/*! 2024-03-20 */
|
||||
!function(u){u.fn.loadMoreNews=function(e){var s=2,n=!1,o={loadingElementId:"#loading",container:"",url:document.location.pathname},a=(u.extend(o,e),u(o.loadingElementId,this));a.hide(),this.click(function(e){var t,i;e.preventDefault(),n||(n=1,a.show(),t=u(this).attr("disabled","disabled"),i=u(o.container),u.ajax({url:o.url+(0<=o.url.indexOf("?")?"&":"?")+"pagina="+s}).always(function(){n=0,a.hide(),t.removeAttr("disabled")}).done(function(n){n?(i.each(function(){var e=this.toString();u(e).append(u("<div>"+n+"</div>").find(e).length?u("<div>"+n+"</div>").find(e).children():u(n))}),++s):t.attr("disabled","disabled").text("Geen nieuws meer.")}))})}}(jQuery),$(function(){$("[data-loadmorenews]").each(function(){$(this).loadMoreNews($(this).data("loadmorenews"))})}),function(s){s.fn.menu=function(e){var n={menuSubmenuClass:"has_submenu"},e=(s.extend(n,e),s(this).children("."+n.menuSubmenuClass)),i=s(this);e.on("mouseenter",function(){var e=s(this),n=(s(".menu-submenu > ul.submenu").slideUp(400,function(){s(this).closest(".menu-submenu").remove()}),s(".hover",i).removeClass("hover"),e.addClass("hover"),s('<div style="width: '+e.outerWidth()+'px"><a href="'+e.find("a").attr("href")+'" style="width: '+e.outerWidth()+'px"></a></div>').append(e.children("ul.submenu").clone())),t=e.offset();n.addClass("menu-submenu").css({top:t.top,left:t.left}),n.on("mouseleave",function(){s(".menu-submenu > ul.submenu").slideUp(400,function(){s(this).closest(".menu-submenu").remove()}),e.removeClass("hover")}),s("body").append(n),n.children("ul.submenu").slideDown(),n.find("ul.submenu").subMenu({}),openPlayerInNewScreen()})},s.fn.subMenu=function(e){var n={menuSubmenuClass:"has_submenu"};s.extend(n,e),s(this).find("li."+n.menuSubmenuClass+" > a").click(function(e){e.preventDefault();e=s(this).closest("li");e.children("ul.submenu").slideToggle(),e.toggleClass("opened")})}}(jQuery),$(function(){$(".menu").menu({}),$(".mobile-menu").subMenu({}),$(".mobile_menu_button a").click(function(){$(".mobile_menu_container").show()}),$(".mobile_close_menu_button a").click(function(){$(".mobile_menu_container").hide()}),$(".mobile_menu_container").click(function(e){!$(e.target).closest("#mobile_menu_nav").length&&$(".mobile_menu_container").is(":visible")&&$(".mobile_menu_container").hide()})}),$(function(){$(".prettyPhoto[rel^='prettyPhoto']").prettyPhoto({show_title:!1,slideshow:3e3,overlay_gallery:!0,social_tools:""})}),function(l){l.fn.snapTo=function(e){var n={elementClass:"post"},t=(l.extend(n,e),l(this)),i=t.find("."+n.elementClass+":visible"),s=!1,o=null,a=function(){var n;s||(s=!0,n=t.scrollLeft(),i.each(function(){var e=l(this).offset();if(e.left>-window.screen.width/2&&e.left<window.screen.width/2)return t.animate({scrollLeft:Math.round(n+e.left)+"px"},300),!1}),o&&clearTimeout(o),o=setTimeout(function(){s=!1},500))},u=null;t.on("scroll",function(){u&&clearTimeout(u),u=setTimeout(a,300)})}}(jQuery),$(function(){$("[data-snapto]").each(function(){$(this).snapTo($(this).data("snapto"))})}),function(s){s.fn.tabs=function(e){var n={tabClass:"box_header",activeClass:"active",contentClass:"tab_content"},t=(s.extend(n,e),s(this).find("."+n.tabClass)),i=s(this);t.click(function(e){e.preventDefault(),t.removeClass(n.activeClass),i.find("."+n.contentClass).removeClass(n.activeClass),i.find("#"+s(this).data("tab-content-id")).addClass(n.activeClass),s(this).addClass(n.activeClass)})}}(jQuery),$(function(){$("[data-tabs]").each(function(){$(this).tabs($(this).data("tabs")??{})})});
|
||||
Reference in New Issue
Block a user