2017-02-28 58 views
0

我已經爲我的應用程序應用了背景圖像選項,但它的工作良好。但我想修復背景圖像使用適合選項,如填充,適合,strech等......如何爲我的應用程序應用該選項取決於用戶選擇的選項。背景圖片適合選項?

code:

+3

請添加您的代碼。 – dorado

+0

@(Html.Kendo()。DropDownList的() 請將.Name( 「infobgimagefitType」) .Events(EV => ev.Open( 「positionDropDown」)) .BindTo(inSisEnums.Enums.EnumToSelectList(typeof運算(inSisEnums。 InfobgimageFitType))) .SelectedIndex(((int)的ViewBag.Settings.Imagefittype)) .HtmlAttributes(新{式= 「寬度:90像素;字體大小:小;浮動:右」}) ) –

+0

我想以像Windows桌面圖像一樣工作的功能 –

回答

0

爲fill,Stretch和fit創建CSS類。 使用addClass將它們添加到背景div或使用toggleClass通過JS進行切換。

.fill { 
    background: url('image.jpg'); 
    background-repeat: repeat; 
} 

.stretch{ 
    background: url('image.jpg'); 
    background-size: cover; 
}