Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery console error: $(this).effect is not a function

I've been staring at my code for hours now trying to work out why this seemingly simple play around with jQuery isn't working:

<!DOCTYPE HTML>

<html>

    <head>

        <title>title</title>

        <meta charset="UTF-8">
        <meta name="keywords" content="test">
        <meta name="description" content="test">

        <link rel="stylesheet" type="text/css" href="style.css">

    </head>

    <body>
        <p class='box' id='title'>&quot;test&quot;</p>
        <div class='gallery'>
            <p class='tNail' id='one'>
            <p class='tNail' id='two'>
            <p class='tNail' id='three'>
            <div class='clear'></div>
            <p class='tNail' id='four'>
            <p class='tNail' id='five'>
            <p class='tNail' id='six'>
            <div class='clear'></div>
        </div>
        <div class='clear'></div>
        <p class='footer'>test 2011 <a href='#'>test</a></p>
    </body>

    <script type="text/javascript" src="jquery.js"></script>
    <script>
        $(document).ready(function()
        {
            $(".tNail").click(function()
            {
                $(this).effect("scale", {percent:200, direction:'both'}, 1000);
            });
        });
    </script>

</html>

I've tried using noConflict() to no avail. If anyone can shed some light I'd be grateful.

Thanks.

like image 546
Lee Avatar asked Nov 18 '11 12:11

Lee


1 Answers

Ah, looking again, I think the error message is probably "$(this).effect is not a function" (which is rather different from ${this}). You haven't loaded jQuery UI, which is where the effect method is defined.

Include the jQuery UI library and try again.

like image 176
lonesomeday Avatar answered Sep 30 '22 15:09

lonesomeday