我正在尝试将背景图像添加到div中,但是这样做有一些问题。我在SO上遇到了this和this解决方案,以便为div添加背景图片,但是尝试这些解决方案后,我仍然遇到以下错误
TS2339:类型'CheckoutComponent'上不存在属性'addi'。
13
我将图像文件夹放在src / images / addi.jpg和src / app / checkout / images / addi.jpg之下,但仍然出现相同的错误。这是我要为其添加背景图片的div块
public class ModelDTO { public string MyProperty1 { get; set; } public int MyProperty2 { get; set; } }
我仍然对angular还是陌生的,很高兴知道该文件夹的确切位置
1 个答案:
答案 0 :(得分:-1)
尝试一下:
/** * Infinite Scroll + Masonry + ImagesLoaded */ $(function() { // Main content container var $container = $('.isotope-box'); // Masonry + ImagesLoaded $container.imagesLoaded(function(){ $container.masonry({ // selector for entry content itemSelector: '.isotope-item', transitionDuration: 0 //stagger: 30, //hiddenStyle: { opacity: 0 } }); }); // Infinite Scroll $container.infinitescroll({ // selector for the paged navigation (it will be hidden) navSelector : ".navigation", // selector for the NEXT link (to page 2) nextSelector : ".nav-next a", // selector for all items you'll retrieve itemSelector : ".isotope-item", extraScrollPx: 150, animate: true, appendCallback: true, bufferPx: 40, scrollThreshold: 600, // finished message loadingImg : "", loadingText : "", loading: { img: "data:image/gif;base64,R0lGODlhAQABAHAAACH5BAUAAAAALAAAAAABAAEAAAICRAEAOw==", msgText: "Loading new artists...", finishedMsg: "The end.", speed: 0 } }, // Trigger Masonry as a callback function( newElements ) { var $newElems = $( newElements ).hide(); $newElems.imagesLoaded(function(){ $newElems.show(); $container.masonry( 'appended', $newElems ); }); }); });
或者只是为该图像样式添加一个类,然后将该类添加到我的行旁边。并使用该类。正如我可以告诉您的那样,您不想像示例中那样动态更改背景,您只想设置背景图像。所以只需使用CSS。