Get a free trial // Grow your CSS skills // Land your dream job

tuning js snippet for wordpress

  • # February 11, 2013 at 3:19 pm

    Hey all,

    i have this small script, that i’d like to embed into a wordpress site. in plain html it’s working!

    function interval() {
    $(‘.box’).effect(‘shake’, { times:5 }, 800);
    $(document).ready(function() {
    var shake = setInterval(interval, 4000);

    i know there are some safety measures in wp, that demand to have something like this:


    But still i cannot figure out the right syntax for this because of the interval stuff…

    Can somebody help me?

    # February 11, 2013 at 3:24 pm

    @bogus, just wrap everything in:

    jQuery(function($) {
    // Your snippet here
    No. 5 for reference

    # February 11, 2013 at 4:00 pm

    thanks! easy as that! <3

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed