You can define this method in an .asmx web service and call it via jQuery AJAX. The AJAX client side would look like this:
var val = <value for="" eleid="">
jQuery.ajax({
url: "service.asmx/CreateDivSize",
type: "POST",
data: '{"eleId":"' + val + '"}',
contentType: "application/json; charset=utf-8"
}).done(function (ds) {
});</value>
You can execute this AJAX request on any event you want, but please note that I have not had a great luck using JQuery AJAX with ASP.NET because AJAX calls like these don't seem to update the view-state correctly so any ASP.NET postback that depends on the change to viewstate, for e.g. UpdatePanels, might behave weirdly.
Please make sure you take care using these 2 things together.