Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wordpress Menu Error - Can you shed any light?

Featured Replies

Basically this error has came out of no where.. Last night it wasn't even issue and everything was working fine. However, I checked this morning and I'm not sure whether the client has done anything or if something has stopped working.

 

If you visit http://strawberrylemonadeonline.com/ on your mobile device, the navigation messes up and text appears outside the select. I've been fiddling for ages and I cannot find a solution. It's even harder as on dev tools, I'm not getting the error happen only on genuine mobile devices.. Can anyone help?

 

 

ps - I appreciate the code is awful, I got approached by a client who didn't want to pay the original web company who created the site to fix small errors, so he came to me.

 

Thanks

Looks like there are some javascript errors, notably :

 

setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.width())), 'reset', 0);

 

Uncaught TypeError: Cannot read property 'left' of undefined

 

 

Its from this function (below) so you'll want to go through it and find out exactly what isn't working here. Have a look at

 

var lastChild = slider.children.last();

var position = lastChild.position();

var setSlidePosition = function(){
			// if last slide
			if(slider.active.last){
				if (slider.settings.mode == 'horizontal'){
					// get the last child's position
					var lastChild = slider.children.last();
					var position = lastChild.position();
					// set the left position
					setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.width())), 'reset', 0);
				}else if(slider.settings.mode == 'vertical'){
					// get the last showing index's position
					var lastShowingIndex = slider.children.length - slider.settings.minSlides;
					var position = slider.children.eq(lastShowingIndex).position();
					// set the top position
					setPositionProperty(-position.top, 'reset', 0);
				}

Edited by mantis

  • Author

 

Looks like there are some javascript errors, notably :

 

setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.width())), 'reset', 0);

 

Uncaught TypeError: Cannot read property 'left' of undefined

 

 

Its from this function (below) so you'll want to go through it and find out exactly what isn't working here. Have a look at

 

var lastChild = slider.children.last();

var position = lastChild.position();

var setSlidePosition = function(){
			// if last slide
			if(slider.active.last){
				if (slider.settings.mode == 'horizontal'){
					// get the last child's position
					var lastChild = slider.children.last();
					var position = lastChild.position();
					// set the left position
					setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.width())), 'reset', 0);
				}else if(slider.settings.mode == 'vertical'){
					// get the last showing index's position
					var lastShowingIndex = slider.children.length - slider.settings.minSlides;
					var position = slider.children.eq(lastShowingIndex).position();
					// set the top position
					setPositionProperty(-position.top, 'reset', 0);
				}

Thanks for the help! Much appreciate it. I'll take a look further.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.