
-
AuthorPosts
-
April 15, 2018 at 12:05 pm #942172
hi
i have accordions on the homepage. i want to make the accordions expand on hover instead of click.
I saw that people have asked this question in the past, and you said to change some code. however, i am not comfortable or experienced enough to play around with code…
can you please do it for me? please note that i am using a child theme and wouldn’t want the changes to be lost with an update…
thanks for your help.
April 15, 2018 at 12:24 pm #942176What did you do on touchscreens ?
April 15, 2018 at 12:27 pm #942177you can only open the read more when you click and i want it to open when you hover over the read more
can you please do it for me?
April 16, 2018 at 3:03 am #942382Hi,
I edited this file in the enfold theme folder: js/shortcodes.js and found this code:thisheading.on('click', function()
and replace it with this code:
thisheading.on('mouseover', function()
Then I copied the modified shortcodes.js to your_child_theme_folder/js/shortcodes.js and added this at the very end of your child theme functions.php file:
function change_aviajs() { wp_dequeue_script( 'avia-shortcodes' ); wp_enqueue_script( 'avia-shortcodes-child', get_stylesheet_directory_uri().'/js/shortcodes.js', array('jquery'), 3, true ); } add_action( 'wp_enqueue_scripts', 'change_aviajs', 100 );
This is working on my localhost after a hard cache flush, yet clearing your cache several times has not helped. I don’t see a cache plugin on your site. So please look on your webhost for any host level caching that you can clear, or ask your host if they can assist.
Best regards,
MikeApril 16, 2018 at 10:32 am #942489Hi,
I’m happy to report that since a few hours have pasted, the edited shortcodes.js in the child theme is working as expected.
Is there anything else we can assist with on this, or shall we close this?Best regards,
MikeApril 24, 2018 at 9:19 am #945758thanks for doing it.
at the moment the accordion expands when hovering and then stays open even when not hovering. i have to hover over it again in order to close it.is it possible to make it expand when you hover, but it should close automatically when i move the mouse away from the element?
thanks
April 25, 2018 at 2:17 am #946338Hi,
Unfortunately this is the intended behavior, normally you have to click to open & click to close. We have only replaced the click action for mouseover, but there is nothing in place to have a default no action presence. If there was there is a good chance it would interfere with the normal actions.
You can request customization here, as this kind of customization as it is beyond the scope of support we can provide here.Best regards,
MikeApril 25, 2018 at 11:47 am #946530thanks.
at the moment, the accordion is very jumpy and it’s annoying.
please change it back to expanding by clicking. i am sorry for driving you crazy but it cannot stay the way it is.thanks
April 25, 2018 at 12:44 pm #946546 -
AuthorPosts
- You must be logged in to reply to this topic.