how to use curvyCorners only for top

btoland - February 15, 2008 - 13:27
Project:curvyCorners
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

When I use the following code my curveyCorners disappear when I log out! They return when I log in as any user.

window.onload = function()
  {
     settings = {
          tl: { radius: 10 },
          tr: { radius: 10 },
          bl: { radius: 10 },
          br: { radius: 10 },
          antiAlias: true,
          autoPad: true,
            validTags: ["div"]
      }

   var divObj1 = document.getElementById("some-block-id");
   var divObj2 = document.getElementById("someother-block-id");

     var cornersObj = new curvyCorners(settings, divObj1, divObj2);
           cornersObj.applyCornersToAll();
         
}

This post on google groups helped me work around the problem:
http://groups.google.com/group/curvycorners/browse_thread/thread/dc79111...

I changed my code to this:

window.onload = function()
  {
     settings = {
          tl: { radius: 10 },
          tr: { radius: 10 },
          bl: { radius: 10 },
          br: { radius: 10 },
          antiAlias: true,
          autoPad: true,
            validTags: ["div"]
      }

   var divObj1 = document.getElementById("some-block-id");
   var divObj2 = document.getElementById("someother-block-id");

     var cornersObj = new curvyCorners(settings, divObj1);
           cornersObj.applyCornersToAll();

     cornersObj = new curvyCorners(settings, divObj2);
           cornersObj.applyCornersToAll();
         
}

This put the curvyCorners back on when I logged out. They're still missing when I'm in the admin pages but I don't mind that too much.

Weird that var cornersObj = new curvyCorners(settings, divObj1, divObj2); works when users are logged in but not when logged out. No idea what's going on with the admin pages.

I'm working on a local host dev right now but will be going live soon and will post link to site if required to get to the bottom of this. Too busy writing content to do that now!

Many thanks,
-Ben.

#1

btoland - February 15, 2008 - 13:40

This is the javascript error I get when my corners don't appear.

boxCol[i] has no properties
http://.............../sites/all/contrib/curveycorners/rounded_corners.i...

#2

asak - March 15, 2008 - 09:49

That fixes it.

In the readme, the code has all cornersObj.applyCornersToAll(); at the bottom. That doesn't work.
When adding them after every cornersObj = new curvyCorners(settings, divObj2); it works for all users.

So now my code looks like:

window.onload = function()
  {
     menu = {
          tl: { radius: 10 },
          tr: { radius: 10 },
          bl: { radius: 10 },
          br: { radius: 10 },
          antiAlias: true,
          autoPad: true,
            validTags: ["div"]
      }

               var divObj1 = document.getElementById("block-i18nblocks-1");
               var divObj2 = document.getElementById("block-translation-0");
               var divObj3 = document.getElementById("block-signup-0");

var cornersObj = new curvyCorners(menu, divObj1);
           cornersObj.applyCornersToAll();
cornersObj = new curvyCorners(page, divObj2);
           cornersObj.applyCornersToAll();
cornersObj = new curvyCorners(menu, divObj3);
           cornersObj.applyCornersToAll();

}

And it works!

Thanks!

#3

asak - March 16, 2008 - 09:10

Still doesn't work for IE...

#4

bstrange - March 26, 2008 - 07:44

Not working for me in IE7 either and using your final code snippet above, I still get boxCol[i] error, only this time on line 86 instead of 46...

#5

sankar_jeya - September 20, 2008 - 11:51
Title:CurvyCorners disappearing from blocks in Admin pages and when logged out» how to use curvyCorners only for top
Category:bug report» support request

Hi iam using this module and .. plz any one help me how to set only curve on top .. if there is any patch file plz send it .. i used $('#block-views-politics-block_1 .title').corner({
tl: false,
tr: false,
bl: { radius: 8 },
br: { radius: 8 },
antiAlias: true,
autoPad: true,
validTags: ["div"] }); this code .. but no use ...

 
 

Drupal is a registered trademark of Dries Buytaert.