Log in

View Full Version : Updating Menu scripts for iPad/iPhone and Android devices in Accordion



SAS
05-05-2015, 10:30 AM
Hi,

I was looking for some advice where to put the following code to update the menu script for Accordion?:
www.dynamicdrive.com/forums/entry.php?245-Updating-Menu-scripts-for-iPad-iPhone-and-Android-devices

"var ismobile=navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i) != null, //boolean check for popular mobile browsers"


I do not see it in Accordion Content script (v2.0)
www.dynamicdrive.com/dynamicindex17/ddaccordion.htm#scrolltoheader

Any help would be appreciated,

Thanks
Kev

Beverleyh
05-05-2015, 03:04 PM
Hmmm, I can't see why the modification would benefit that particular script.

Is there something in it's behaviour that indicates to you why it's needed? Does it not work for you in certain cases?

I can confirm that it works fine here on iPad and iPhone.

SAS
05-05-2015, 09:15 PM
The script doesn't work on Chrome and Opera on Ipad and Iphone. It works on Safari and works on all browsers on windows PC

Beverleyh
05-05-2015, 09:43 PM
I can't say I'm seeing any problem.

The demo page works fine here on iPhone 5S and iPad Mini using the following browsers;
- Safari
- Chrome
- Mercury
- Dolphin
- Opera

Which aspects aren't working for you in Chrome and Opera on iPhone / iPad?

SAS
05-05-2015, 10:54 PM
The initial code is to expand the text with the hover action, this is not possible on a touchscreen so I guessed the code would resolve it by seeing it is a phone/ipad and change it to a click to action.

My issue is that you have to hold down the click on the phone which selects the header bar, then click again and it expands. I seam to have to hold it down for longer to expand it as appose to a quick click to expand. Is there a way to shorten the click time?

(Thanks for the amount of effort you are spending on this Beverleyh)

Beverleyh
05-06-2015, 05:04 AM
I tested every header bar and link in the demo page in all those browsers and everything opens with a single tap for me - no long press. The 300ms delay is there but then it always is - maybe try Swiftclick to eliminate it? There's some info on that in this blog entry http://www.dynamicdrive.com/forums/entry.php?295-Beat-the-300ms-Delay-on-Touch-and-Close-Sub-Menus

I don't experience any need for holding down though. Are we talking about the same demo? Please direct me to the specific area where you're having problems because at the moment I'm not seeing any in the 5 iOS browsers ive tested in.

SAS
05-06-2015, 12:18 PM
It was specifically on my page I did 6 years ago and thought it would need a bit of updating. Here is the link: http://www.sascomputing.com/services.php. (it missed it on my first post)

Beverleyh
05-06-2015, 12:34 PM
As the problem does not present itself in the DD demo page, what I would do in your shoes is reconstruct a test page, starting with just the DD demo, and building back up in logical blocks (to recreate your full page) until you find the script that is causing problems/conflicts.

I've a feeling it's the FastClick script that is the root of your woes - read my blog post http://www.dynamicdrive.com/forums/entry.php?295-Beat-the-300ms-Delay-on-Touch-and-Close-Sub-Menus - other people have noted issues with it too. An alternative (SwiftClick) is included in the post so you might be able to try that. Or leave both out altogether - your website isn't responsive so that's a bigger issue than the usual 300ms delay on iOS .