Hi Rick,

Funny thing is that I never included custom.js at all. Take a look at the file attached. Its basically your code but just reworked a little bit with the changes that I suggested earlier.

Whats in custom.js? I'm curious to know why pushing it to the head resolved the issue.

Rey...

Rick Faircloth wrote:
Rey,

I tried changing my code and tried your code, but still get the same

response on the HTML page… text is static.  The cursor does change

to hand when I mouseover the title, however.  Seems like the js isn’t

working at all.  I know I’m just missing something simple.

I put the jquery.js and custom.js in the same directory as the

HTML page just to make sure it’s not a path problem.

See any problem in the code below?

Thanks for your help!

Rick

Between the head tags I have:

<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript" src="custom.js"></script>


My custom.js contains:


$(document).ready(function() {

$("div.ann").find("p.title").hide().end().find("p.text").click(function()

  {

           if ($("p.title").is(':visible')) {

               $("p.title").slideUp();

           } else {

               $("p.title").slideDown();

           }

       });

  });


My HTML page has:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

        <title>Untitled</title>

<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript" src="custom.js"></script>
</head>

<body>

<div class="ann">

<p class="title" style="cursor: hand;">

This is the title...

</p>

<p class="text">

This is the text...

</p>

</div>

</body>

</html>


------------------------------------------------------------------------

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Title: Untitled

This is my title.

This is my text.

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to