Question

Something like this:

div.Style.BorderRadius = "50%";

There is no such property apparantly.

What is the alternative for this?

Was it helpful?

Solution

Since BorderRadius is missing from the Style definition/metadata, there are a few options:

  1. Workaround:

    Script.SetField(div.Style, "borderRadius", "...");

  2. Fix the piece that is missing:

    Update the code in https://github.com/nikhilk/scriptsharp/blob/cc/src/Libraries/Web/Html/Style.cs and submit a pull request.

    Or at the very least, log an issue.

OTHER TIPS

It's supposed to be .style.borderRadius (case sensitive), e.g.

var x = document.getElementById("example");
x.style.borderRadius = "14px 33px 50px 72px";

jsFiddle here.

Use jQuery bindings:

jQuery.FromElement(div).CSS("border-radius", "50%");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top