Adding .js file to my Quark child theme

Multipurpose WordPress Theme Forum Support
GK User
Fri Nov 13, 2015 2:16 am
Hi.

I need to add the following code to my child template:
Code: Select all
$(function() {
    var videos = $(".circle-video-dark");
    videos.on({
        mouseenter: function() {
            if (this.paused) this.play()
        }
    });
})

I have so far js folder with an empty functions.js in it. This is my firs time dealing with java script and I don't know how to go about it.

I'm trying to achieve something like this: https://jsfiddle.net/bordomat/6u7h7yxj/12/

Thank you.

Matej.
User avatar
Senior Boarder

GK User
Fri Nov 13, 2015 8:53 am
Hi,

If you are using a child theme, please copy js/functions.js file from your parent theme, add your code at the end of this file and copy it into your Child/js directory.
User avatar
Moderator

GK User
Fri Nov 13, 2015 1:21 pm
Hi,

Do I have to do anything to functions.php file?

M
User avatar
Senior Boarder

GK User
Fri Nov 13, 2015 2:56 pm
Ok. It works. No need for further customization for this functions.js in child theme to work.

Thank you.

M
User avatar
Senior Boarder


cron