Rails with Jquery/running into a problem

1 view
Skip to first unread message

Zayd Connor

unread,
Jun 10, 2009, 2:10:06 AM6/10/09
to rubyonra...@googlegroups.com
I'm going through some beginner tutorials for Jquery, and Im running
into an issue.
The whole purpose of the tutorial is to get a red box to fade out when
clicking on the click me link, this does not work for me

Could my setup be configured incorrectly?
correctly.

I put my jquery-1.3.2.js in my projects /public/javascripts folder.

I created a js script called jo.js in /public/javascripts that looks
like this:
$(document).ready(function() {
$('a').click(function() {
$('#box').fadeout('slow');
});

});

This is how I referenced the jo.js file in my html file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<script src="/javascripts/jquery-1.3.2.js"
type="text/javascript"></script>
<title>index</title>
<%= javascript_include_tag "jo.js" %>
<%= stylesheet_link_tag "jcss" %>

</head>
<body>
<div id="box"></div>
<a href="#">Click Me!</a>
</body>
</html>

When i click on the click me link the box above it is supposed to fade
out, this is not happening.

Thanks
--
Posted via http://www.ruby-forum.com/.

Zayd Connor

unread,
Jun 10, 2009, 2:40:48 AM6/10/09
to rubyonra...@googlegroups.com

Silly me
the function I was calling should be camel cased

Didnt work => $('#box').fadeout('slow');
This worked perfect => $('#box').fadeOut('slow');

p_W

unread,
Jun 10, 2009, 6:38:23 AM6/10/09
to Ruby on Rails: Talk
Good catch. A good resource for any more jQuery-related questions
is http://groups.google.com/group/jquery-en?hl=en

Good luck!

On Jun 10, 2:40 am, Zayd Connor <rails-mailing-l...@andreas-s.net>
wrote:
Reply all
Reply to author
Forward
0 new messages