jquery wrapper
aaron - February 8, 2008 - 02:37
| Project: | curvyCorners |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
this patch will make the module more jquery friendly, from http://www.aspcode.net/JQuery-Curvy-Corners.aspx
apply the patch, and include the js file in the module directory (rename it, removing the .txt). after that, you don't need to do all that window.onload stuff, and just do something like the following:
<script type="text/javascript">
$(document).ready(function()
{
$('.title').corner();
})
</script> | Attachment | Size |
|---|---|
| curvycorners-jq.patch | 483 bytes |
| curvycorners-jquery-wrapper.js_.txt | 522 bytes |

#1
or rather, use drupal_to_js, don't do the script stuff, obviously...
#2
I applied the patch and it doesn't seem to work. Here is a copy of the module with the patch applied.
In the "curvyCorners to apply on all pages" box I put:
$(document).ready(function(){
$('div#test').corner();
});
but do not get rounded corners on my div.
#3
For the record, you can accomplish this *without* patching, by using the following code instead:
$(document).ready(function() {
settings = {
tl: { radius: 10 },
tr: { radius: 10 },
bl: { radius: 10 },
br: { radius: 10 },
antiAlias: true,
autoPad: false,
}
$blocks = $('.block-left, .block-right');
$blocks.each(function() {
varCC = new curvyCorners(settings, this);
varCC.applyCornersToAll();
});
});
#4
#3 works great for me in Firefox without patching, but not in Internet Explorer 7: no corners there and a javascript error.