开发者

Redrawing rounded corners when using curvycorners-plugin for jQuery

I'm using the curvycorners jQuery plugin (http://www.curvycorners.net/instructions/) to force IE to render rounded corners on divs.

It works really well, apart from one thing: I have a validation error-message that pops up inside the div, using jQuery's "show" method.

Curvycorners adds an extra div that is absolute positioned and has a set height, this means that you have to redraw the rounded corners if you want the containing div to resize when the error-message is shown.

Curvycorners include a functions you can call to redraw the rounded corners, however it doesn't execute when I put it inside this click-function:

$("input[type='submit']").click(function(e) {
curvyCorners.redraw();
});

This is my markup:

<fieldset class="curvyRedraw">      

<legend>Some le开发者_JAVA百科gend</legend>

<form id="someForm">

<div id="error-message"></div>

<div class="buttons">
    <input type="submit" id="cancel" value="Cancel" name="action" />
    <input type="submit" id="submit" value="Confirm" name="action" />
</div>

</form>

</fieldset>

Anyone had similar issues?


Yeah, i ran into this issue to yesterday.

curvyCorners.redraw(); is a function of the normal curvycorners library, so that won't work.

over here @ google code they say you can use something like

$('input[type=submit]').redrawCorners();

They say it's fixed (it was bugged), but it did not do the trick for me because i'm using dynamic content. Maybe it can solve your problem.

Sorry for the short answer, i'm in a hurry..


You have to call removeCorners() and redrawCorners() on element, that has rounded edge (as I understand, #error-message should be rounded):

$('#error-message').removeCorners().redrawCorners();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜