Closed (outdated)
Project:
Imagemenu
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Jun 2010 at 21:39 UTC
Updated:
27 Jun 2018 at 17:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
puppetmast0r commentedConsider using one big image with all the buttons in all states, then changing the "background-position" of the button upon mouseover (hover).
Comment #2
ratinakage commentedI would also like this feature...
Thanks!!
Comment #3
marcus_clements commentedPost a patch and I will review and commit to the code.
Comment #4
ratinakage commentedHmmm. I'm not really a module developer but I hacked my theme to preload my images. Just show them in the php template and then hide them with css.
Comment #5
glueck-medien commentedyou can hack imagemenu.module like this.
notice that the javascript must be inserted BETWEEN the li tags!
instead of using javascript you could insert any other way of preloading if you want (e.g. insert a hidden picture...)
Code, line 493-...:
Comment #6
marcus_clements commentedIf someone wants to write a preload javascript function that gets embedded in the page if a setting is activated in the module settings, I will be delighted to review and commit.
Comment #7
glueck-medien commentedok. i will do when i find the time...
hope this will happen :-)
Comment #8
tunicFirst thanks for this module, I've used it several times.
I need rollover images preload, so I have written a patch to do it.
It's a quick fix, so it may be improved.
It adds a configuration setting (Preload rollover images) in the image menu settings page (admin/build/menu/imagemenu/settings) to enable/disable this funcionality.
How it works? It just creates a JS Image object setting its source to the rollover image to preload. This is done one time for each image to preload. Using drupal_add_js each rollover image path is added to Drupal.settings.imagemenu_preloads array in the theme_imagemenu_item function. Again, using drupal_add_js, the JS function to preload all rollover images (reading input from Drupal.settings.imagemenu_preloads), is added in the imagemenu_build_output function.
glueck-medien in #5 pointed out a similar solution (using Image objects) but when I wrote this patch I didn't see his post. Instead of embebing a script tag inside li tag, this patch delegates the preload to the JS layer. It may generate cleaner HTML output (because no script tag is inserted inside li tags), but I think that it can be rewroted to fit better imagemenu internals (sorry, I don't know well how imagemenu module), for example loading rollover data from database instead of adding one by one in theme_imagemenu_item.
To use this patch apply it to the module, put the attached imagemenu.txt file in the module directory and rename it to imagemenu.js (js files can't be attached in drupal.org).
I've tested this patch successfully in a site with two imagemenu blocks.
Comment #9
tunicOoops, changing status to 'needs review' because a patch is included.
Comment #10
summit commentedSUbscribing, greetings, Martijn
Comment #11
deepbluesolutions commentedconfirmed the patch in #8 worked for me. could do with image size parameters on the image menu, also noticed a bug, when selecting images from browse on a menu, a / is put at the start of the path, if you remove the / the path saves and works as expected, but if you dont, you get a file path error.
# patch -p0 < imagemenu_preload_rollovers.patch
patching file imagemenu.admin.inc
Hunk #1 succeeded at 515 (offset -1 lines).
patching file imagemenu.module
Hunk #1 succeeded at 433 (offset -1 lines).
Hunk #3 succeeded at 501 (offset -1 lines).
[root@webgateway imagemenu]# more imagemenu.info
name = Imagemenu
description = Module to create menus from image files.
core = 6.x
package = Menu
php = 5.0
; Information added by drupal.org packaging script on 2011-02-25
version = "6.x-1.x-dev"
core = "6.x"
project = "imagemenu"
datestamp = "1298619421"
Comment #12
pobster commentedClosing as D6.x is now unsupported.