Pregunta

Something like this:

div.Style.BorderRadius = "50%";

There is no such property apparantly.

What is the alternative for this?

¿Fue útil?

Solución

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.

Otros consejos

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%");
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top