Active
Project:
DHTML Menu
Version:
7.x-1.x-dev
Component:
Javascript code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
23 Jun 2008 at 12:02 UTC
Updated:
18 Dec 2009 at 18:24 UTC
Hi,
Perhaps this is not an important feature, I don't expect this will be implemented but please, if you could help memake this, I will be happy.
Since my website is visited by lots of visual impaired people, it will be great if when the user clicks and open or close a menu, a little wav sound will be played, one for open and one for closed.
I'd like to know if it is possible and if yes, what sort of code should I insert into javascripts or module?
thanks in advance.
Comments
Comment #1
cburschkaThe D5 version will not receive any new features; only D6 will.
Firstly, I'm a bit dubious about using this Javascript visual stuff on a site for disabled users, because it is difficult for screen-readers and Braille displays to cope with it.
You can add this with Javascript in a specific theme, without having to modify the module code. Unfortunately playing sounds in Javascript is not something I'm familiar with.
Comment #2
drein commentedwell,
it's quite true, anyway screen readers are able to manage well this java scripts. I can say this because I'm visual impaired too, and I have no problems using open/close menus.
Anyway, I don't want to upgrade to d6, due to some modules that I'm using that are not upgraded now, so I think to attempt to using some theme capability or modify the javascript, now I'll see.
Thanks anyway.
Comment #3
cburschkaThere is a jQuery sound plugin.
http://dev.jquery.com/view/trunk/plugins/sound/
Comment #4
cburschkaThis will land in D7 first and might be backported later.
Comment #5
cburschkaI've thought about this a few times and determined that the sound plugin of jQuery is so much extra code to include with DHTML menu that this feature won't make it into the "core" module. However, the module could well use a behaviors object (the same way Drupal has Drupal.behaviors) to bind custom actions to the two main DHTML events, opening and closing menus. This would involve perhaps 4-5 extra lines of Javascript in dhtml_menu.js that would be ignored if the extension is not used.
To extend, you would just need a custom JS file doing something like
Comment #6
johnpitcairn commentedYes! This would be most useful, especially if back-ported to Drupal 6.
I'm currently looking at overriding Drupal.dhtmlMenu.toggleMenu, because unfortunately the slide effect also manipulates opacity. jQuery uses a filter to do this for IE 6 & 7, which turns text antialiasing off when the menu slides down. Not good - I need remove the opacity change, but keep the slide.
It would be more maintainable to roll my own jQuery behaviour and attach that, instead of overriding the entire function.
Comment #7
drein commentedAh, that's seems interesting!
I upgraded to drupal6, I'll make some test with java codes you provide.
Thanks.
Comment #8
cburschkaIn 7.x-1.0 and 6.x-4.0, the animation effects (opacity, etc.) can be picked in the UI anyway, so there is no need to write any Javascript.