views:

47

answers:

1

Hiya, I am attempting to use the jCorner plugin for jQuery, but falling down at the majority of the hurdles. See http://www.malsup.com/jquery/corner/ for the plugin, but I do not understand the concepts behind jQuery.

The code is at http://ghostworksinc.com/new, then hit view source to see the hash I've made.

The code is compiled with a sinatra app running at Heroku.

The div I want to corner-ify has an id of cornered and a class of cornerdiv, and given that I know no javascript whatsoever I'm stabbing in the dark.

Does anybody have any working code for using jCorner?

Thanks, Luke

$(function(){ $('div.cornerdiv').each(function() { $(this).corner(); }); });
+4  A: 

hi you're including the corner plugin before you're including jquery.

try switching them

<script type="text/javascript" src="../javascripts/jquery.corner.js"></script>  
<script type="text/javascript" src="../javascripts/jquery-1.4.2.min.js"></script>

to

<script type="text/javascript" src="../javascripts/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../javascripts/jquery.corner.js"></script>  
Tim
To elaborate, the `<script>` tag that imports jQuery needs to be above any `<script>` tags that import jQuery plugins.
Matt Ball
+1 What tim said
Mark Schultheiss
+1 - The corner plugin relies on jQuery in order to function. When it loads, there is no jQuery yet.
patrick dw
You can also shorten your code to - $('.cornerdiv').corner();
Castrohenge
Thank you very much for your help
lcarpenter