当标题图像存储在javascript中时,如何在我的媒体查询中将同一图像的不同大小添加到主页标题中?

当标题图像存储在javascript中时,如何在我的媒体查询中将同一图像的不同大小添加到主页标题中?,javascript,css,jquery-backstretch,Javascript,Css,Jquery Backstretch,这是我的横幅图像存储在javascript中的位置: ``` ``` 我想为手机和其他屏幕尺寸添加另一个版本的横幅图像。我是否将它们添加到javascript中?如何链接媒体查询中的所有内容?您正在使用jQuery插件Backstretch 快速查看中的文档可以看出这是一个内置功能。只需传递一组图像和宽度 // Or, to automatically choose from a set of resolutions. // The width is the width of the image

这是我的横幅图像存储在javascript中的位置:

```

```


我想为手机和其他屏幕尺寸添加另一个版本的横幅图像。我是否将它们添加到javascript中?如何链接媒体查询中的所有内容?

您正在使用jQuery插件Backstretch

快速查看中的文档可以看出这是一个内置功能。只需传递一组图像和宽度

// Or, to automatically choose from a set of resolutions.
// The width is the width of the image, and the algorithm chooses the best fit.
$(".foo").backstretch([
  [
    { width: 1080, url: "path/to/image1_1080.jpg" },
    { width: 720, url: "path/to/image1_720.jpg" },
    { width: 320, url: "path/to/image1_320.jpg" }
  ]
]);

不同的版本意味着不同的图像或不同的大小?@mathur相同的图像但不同的大小/作物。
// Or, to automatically choose from a set of resolutions.
// The width is the width of the image, and the algorithm chooses the best fit.
$(".foo").backstretch([
  [
    { width: 1080, url: "path/to/image1_1080.jpg" },
    { width: 720, url: "path/to/image1_720.jpg" },
    { width: 320, url: "path/to/image1_320.jpg" }
  ]
]);