In events: Show/hide without effect

Issues related to previewing and publishing your web site.
Post Reply
Hannu
Posts: 10
Joined: Sat May 30, 2015 5:19 am

In events: Show/hide without effect

Post by Hannu » Thu Sep 10, 2015 8:41 am

Show & hide (without effect) don't always work. Adding an effect helps immediately.
T.ex Slide menu with multiple levels: the upper levels don't hide on mobile Chrome if no effect.
Maybe they should be removed altogether (or internally coded as an effect with length of 0 ms).

H

User avatar
Pablo
Site Admin
Posts: 2636
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: In events: Show/hide without effect

Post by Pablo » Thu Sep 10, 2015 1:05 pm

There are no know problems with these features.
To be able to help you I need to know exactly what you have done. Please be more specific.

Hannu
Posts: 10
Joined: Sat May 30, 2015 5:19 am

Re: In events: Show/hide without effect

Post by Hannu » Thu Sep 10, 2015 5:28 pm

Ok, Here it comes:

Use Chrome mobile browser

1) go tuumaus.fi/hide

events for "SHOW" and "HIDE!" are "show" and "hide" respectively

2) now open sub items from the menu (all the way down)
3) click "HIDE!"

Sub items don't hide, only the main items. With Opera it works, with Chrome not.

4) Then go tuumaus.fi/hideweff

Event for "HIDE!" is now changed to "hide with effect", all else is same

5) see what happens and not happens. The not happens not happens with Opera either

Hannu

User avatar
Pablo
Site Admin
Posts: 2636
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: In events: Show/hide without effect

Post by Pablo » Thu Sep 10, 2015 6:29 pm

1. This is not a bug. This is an illogical way to use the show/hide events. Submenus are a different object so they will not be hidden if you hide the main item.
2. If you use 'hide' then you must make it visible again with 'show', not with 'showwitheffect'. And vise-verse. These are two different methods which affect different CSS properties, so you can mix them.

Note that these are standard jQuery features. I have only made it easier to use them, I did not implement the behavior.
http://api.jquery.com/show/

Hannu
Posts: 10
Joined: Sat May 30, 2015 5:19 am

Re: In events: Show/hide without effect

Post by Hannu » Fri Sep 11, 2015 5:38 am

Ok, thanks for the explanation!
It's a bit of a trap anyway, I think, to have a "hide" option for something that doesn't hide.

User avatar
Pablo
Site Admin
Posts: 2636
Joined: Mon Feb 13, 2006 7:00 am
Location: Europe
Contact:

Re: In events: Show/hide without effect

Post by Pablo » Fri Sep 11, 2015 6:02 am

The jQuery show/hide functions were designed for basic HTML elements, not for advanced scripts like the menubar. There is no way jQuery can keep track of the state of the menubar (or other advanced widgets). It does not 'understand' the behavior of other scripts.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest