Gaya / jQuery--Keep-the-Rhythm

Keep a nice vertical rhythm with elements that don't have one.
20 stars 4 forks source link

Question on calling plugin #3

Closed adrianvalenz closed 9 years ago

adrianvalenz commented 9 years ago

I'm trying to register it using WordPress.

I have two files:

$(document).ready(function () { $("div.rhythm").keepTheRhythm({ baseLine: 20 }); });

$(window).load(function () { $("article img").keepTheRhythm({ baseLine: 20 }); });

Q: Do I use both or I must choose one? and when I do how do I know what selector to use? I want to target images and video embeds.

and I am using wp_enqueue_scripts to call each in the functions.php file.

I changed the baseline to 24 on the myrhythm.js file but no padding is showing up.

What am I doing wrong?

Gaya commented 9 years ago
$(document).ready(function () {
    $("div.rhythm, article img").keepTheRhythm({
        baseLine: 20
    });
});

Would be best I think. You can keep piling up selectors using ,. But I guess you already solved your problem?