I need a round corner on my website. I'm fairly inexperienced with jQuery and JavaScript in general; what's the proper way to load and call this plugin?
+8
A:
You need to use the jquery.corner.js and in your script, just add
$(document).ready(function(){
$("#box1").corner();
});
And in your mark-up, you're supposed to have:
<div id="box1"></div>
You can check out the jQuery Rounded Corners Tutorial for more.
Randell
2009-08-21 15:11:18
where i have to include this @Randell
Rajasekar
2009-08-21 15:13:24
Inside your script tag.
Randell
2009-08-21 15:15:23
<script> $(this).corner(); </script> Like this? @randell
Rajasekar
2009-08-21 15:18:24
Yes, I also edited the sample for your convenience. Make sure you've added the jquery.js and jquery.corner.js.
Randell
2009-08-21 15:20:43
Did it work?
Randell
2009-08-24 14:25:47
Is there some associated css to go with this? It does not seem to work for me.
javamonkey79
2010-07-27 05:16:24
+5
A:
1. Add this code to your head section (assuming your jquery is local):
<script src="Scripts/jquery-1.3.1.js" type="text/javascript"></script>
<script src="Scripts/jquery.corner.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$('div.round').each(function() {
var q = $(this).corner("rounded 7px");
eval(q);
});
});
</script>
2. Add the class="round" to a div wrapper
<div class="round"></div>
- Just add the class="round" to any div you want on your page.
- Change the 7px value to adjust the "roundness" of the corner. A higher number is more round.
James Lawruk
2009-08-21 15:18:02
+2
A:
I would say go with css3. For Firefox it's:
.roundedCorners { -moz-border-radius: 5px; }
For Safari/Chorme it's:
.roundedCorners { -webkit-border-radius: 5px; }
And I'd stop there. Since this is purely a presentation/appearance thing I wouldn't mess with the JavaScript solutions. If your users aren't using a browser that supports css3, they just won't get rounded corners.
Swingley
2009-08-21 15:22:28
A:
This article/tutorial is very thorough: http://woork.blogspot.com/2009/08/css3-rounded-corners-for-every-browser.html
Mdoo
2009-08-21 15:29:57