Hi there,

I don't seem to be able to get to the bottom of a particular problem i have with using jquery in my themes (particularily rounded corners). The rounded corners don't display ... i must be overseeing sth. Here my code. I have downloaded and added jquery.curvycorners.packed.js (http://methvin.com/jquery/jq-corner.html) into a folder drupal/sites/all/scripts/

in page.tpl.php added following

<?php print $scripts ?>

in template.php added following

drupal_add_js('sites/all/scripts/jquery.curvycorners.packed.js');

drupal_add_js(
    '$(document).ready(function() {
      $("div.whois").corner("round 10px");
    });',
    'inline'
  );

in style.css added following:

#whois {
    background-color:#dcdcdc;
    margin-top:10px;
    padding:10px;
}

in block-user-3.tpl.php (the who is online block) added following:

<div id="whois">
  <?php print $block->content; ?>
</div>

The result in the HTML output

in the header for the javascript looks like this:

    <script type="text/javascript" src="/drupal/misc/jquery.js"></script>
<script type="text/javascript" src="/drupal/misc/drupal.js"></script>
<script type="text/javascript" src="/drupal/sites/all/scripts/jquery.curvycorners.packed.js"></script>
<script type="text/javascript">$(document).ready(function() {
      $("div.whois").corner("round 10px");
    });</script>

in the page for the relevant area that should have rounded corners looks like this:

<div id="whois">
  There are currently <em>0 users</em> and <em>0 guests</em> online.</div>

<!--  //-->            </div>

so, even though it seems to load all the relevant jquery / javascripts and it outputs the html correctly, the rounded corners don't display ... do i miss sth. obvious here. Help much appretiated. Thank you.

Comments

Anonymous’s picture

Perhaps you need to update the jquery version...I'm not sure. The jquery_update module does that:

http://drupal.org/project/jquery_update

-Mike Goodwin
http://www.not2us.net
http://www.redleafmedia.com

ajsoellner’s picture

Unfortunately this makes no difference. I have updated jquery.js and also installed the module. Still no rounded corners )-:
Anybody some other suggestions. Maybe a link to a site that uses rounded corners, together with a description?

Thank you ...

ajsoellner’s picture

I knew it would be something obvious ... I have worked it out ...

In block-user-3.tpl.php I have defined a

with an ID, but in the javascript i am calling a class ... It is these little things that are so obvious one seems to oversee so easily. Oh well it works now, which is great.
Anonymous’s picture

I should have noticed that. I'm glad that you figured it out though.

-Mike Goodwin
http://www.not2us.net
http://www.redleafmedia.com

akahn’s picture

ajsoellner, how are the jquery rounded corners working out for you? I'm considering using them on the site I'm working on. Do you notice a performance hit? It seems like it'd be simple to set it up to display any div of a certain class with rounded corners, is this the case? Cheers.