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>

AttachmentSize
curvycorners-jq.patch483 bytes
curvycorners-jquery-wrapper.js_.txt522 bytes

#1

aaron - February 8, 2008 - 02:39

or rather, use drupal_to_js, don't do the script stuff, obviously...

#2

JStarcher - March 16, 2008 - 15:02
Status:needs review» needs work

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.

AttachmentSize
curvyCorners.tar_.gz 577.5 KB

#3

Allie Micka - August 2, 2008 - 00:49

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

hansrossel - October 5, 2008 - 03:49

#3 works great for me in Firefox without patching, but not in Internet Explorer 7: no corners there and a javascript error.

 
 

Drupal is a registered trademark of Dries Buytaert.