我编写了一些代码来生成自定义控件。代码返回一个jQuery元素,调用者将该jQuery元素附加到DOM。我将自定义滚动条应用于生成器代码中的控件,但由于元素尚未附加到DOM,因此没有应用该滚动条。
我的问题是:是否存在任何onAppend事件或类似事件,以便在将元素附加到DOM时应用自定义滚动条?
生成器的示例代码:
function getControl(controlParams){
var $control = $('<div/>');
$control.applyCustomScrollBar(); //Not appended to DOM
我尝试让jQuery处理一个菜单,而CSS则在调整浏览器大小时处理窗口背景。
所以jQuery做了这样的事情:
if ( $(window).innerWidth() < mediaQueries['small']) {
// (where 'small' would be 966)
// Perform jQuery stuff on a menu ul
}
CSS的内容是这样的:
@media all and (max-width: 966px) {
body {
background: url(smallbac
这是我的控制器动作的样子-
public void GetResizedImage(int height, int width, int GroupingId)
{
//Generate image here
image.RenderToStream();
//here i need to execute "$("#modalDialog").dialog("option", "position", 'center');" to center my dialog after image is