我在我的asp.net MVC網站中使用jQuery UI。在一頁上我點擊一個按鈕,然後打開一個新窗口作爲window.open。新打開的窗口在加載時打開Jquery UI彈出窗口。我傳遞一個參數css到window.open。如果該參數不是空的。我想新打開的窗口的jquery彈出使用該樣式表。我的問題是如何使用jquery ui popup的樣式表,因爲jquery ui的css使用自己的圖像,而jquery ui css也使用這些樣式名稱。使用jquery UI的自定義樣式表
請建議
我在我的asp.net MVC網站中使用jQuery UI。在一頁上我點擊一個按鈕,然後打開一個新窗口作爲window.open。新打開的窗口在加載時打開Jquery UI彈出窗口。我傳遞一個參數css到window.open。如果該參數不是空的。我想新打開的窗口的jquery彈出使用該樣式表。我的問題是如何使用jquery ui popup的樣式表,因爲jquery ui的css使用自己的圖像,而jquery ui css也使用這些樣式名稱。使用jquery UI的自定義樣式表
請建議
可以推出自己的主題,通過here,然後在彈出layout.cshtml
頁面,您可以編寫它是
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - My ASP.NET MVC Application</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
if (!string.isNullOrEmpty(Reuqest.QueryString["useCSS"])
{
@Styles.Render("~/Content/css/"+Reuqest.QueryString["useCSS"])
}
</head>
但你沒有提供任何代碼,項目佈局,描述等我只是假設你的意思是一個完整的彈出窗口,而不只是一個jquery.ui.dialog對象。
編輯 此解決方案要求您爲新主題創建捆綁方法。
bundles.Add(new StyleBundle("~/Content/themes/base/css/themeName").Include(
"~/Content/themes/themeName/jquery.ui.core.css",
"~/Content/themes/themeName/jquery.ui.resizable.css",
"~/Content/themes/themeName/jquery.ui.selectable.css",
"~/Content/themes/themeName/jquery.ui.accordion.css",
"~/Content/themes/themeName/jquery.ui.autocomplete.css",
"~/Content/themes/themeName/jquery.ui.button.css",
"~/Content/themes/themeName/jquery.ui.dialog.css",
"~/Content/themes/themeName/jquery.ui.slider.css",
"~/Content/themes/themeName/jquery.ui.tabs.css",
"~/Content/themes/themeName/jquery.ui.datepicker.css",
"~/Content/themes/themeName/jquery.ui.progressbar.css",
"~/Content/themes/themeName/jquery.ui.theme.css"));
我想讓jquery.ui.dialog使用我的樣式表。 – DotnetSparrow
然後看看這個問題http://stackoverflow.com/q/988078/801241 – Qpirate
我需要創建一個上述所有CSS文件的副本,然後使用我的顏色字體等?捆綁商在這裏扮演什麼角色?我使用asp.net MVC 2 – DotnetSparrow
請顯示一些代碼。否則,沒有人能夠知道你的問題在哪裏。 –