Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #485791

    Hi I have an unusual question.

    Client wants the tabs I added to his page Change the content on mouse-over. It obviously would only be for desktop as hover does not work on mobile. Can you help me with this?

    • This topic was modified 8 years, 10 months ago by Diezel23.
    #486092

    Hi Gavin!

    Try changing line 2605 in the /enfold/js/shortcodes.js file from this.

    tab.addClass('tab_counter_'+i).bind('click', function()
    

    To this.

    tab.addClass('tab_counter_'+i).bind('onmouseover', function()
    

    Best regards,
    Elliott

    #486146

    Hi Elliot

    Not sure if it will pick it automatically or not. I have a child theme and copied the js folder and shortcodes.js to the child theme. i’ve made the alterations as you suggested but to no avail. Am i suppose to reference the shortcode.js from the functions.php or not.

    #486149

    Hey!

    Please add following code to Functions.php file of your child theme

    function wp_change_shortcodejs() {
       wp_dequeue_script( 'avia-default' );
       wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/shortcodes.js', array('jquery'), 2, true );
    }
    add_action( 'wp_print_scripts', 'wp_change_shortcodejs', 100 );

    and move modified file inside /js folder
    Regards,
    Yigit

    #486205

    Hi Yigit

    Yeah done that but still does not work

    #486209

    Yigit

    Why do you use – add_action( ‘wp_print_scripts’, ‘wp_change_shortcodejs’, 100 );
    and not – add_action( ‘wp_enqueue_scripts’, ‘wp_change_shortcodejs’ );

    your option did not load the shortcodes the second one did….

    • This reply was modified 8 years, 10 months ago by Diezel23.
    #486244

    Hi!

    So, is the issue fixed now? Please let us know…

    Best regards,
    Basilis

    #487205

    Nope is still does not work

    #487334

    Hey!

    Sorry, it looks like they changed the handler in later versions of jQuery. Try this instead.

    tab.addClass('tab_counter_'+i).bind('mouseenter', function()
    

    Cheers!
    Elliott

    #659984

    tab.addClass('tab_counter_'+i).bind('mouseenter', function()
    This does not work.
    Sorry! I forgot to clear the cache.

    • This reply was modified 7 years, 11 months ago by zhitya.
    #660326

    Hi,

    Glad you got it working :-)

    Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Change Tab click event to hover on desktop’ is closed to new replies.