【发布时间】:2016-03-05 11:28:11
【问题描述】:
我已经看到很多关于这个话题没有明确的答案。 Jquery backstrech 是否支持 DIV 元素内的声明。
这行得通
$.backstretch(imgSrcPath); // attaching to the body element ?
但在 DIV 元素中声明,不起作用。
$("#content").backstretch(imgSrcPath); // by id element
or
$(".Content").backstretch(imgSrcPath); // by class name
一个DIV“内容”定义在html页面的body元素内
<div id="content" class="Content"/></div>
Jquery 组件在 HTML 页面中定义如下
shopping.js 脚本。请注意,imgsrc 包含服务器端单个图像的路径。提醒一下,这在 body 元素 $.backstrech 上定义时有效......而不是我的例子 $("#content")
$(document).ready(function() {
......
$.backstretch(imgsrc});
.....
});
有人能说明一下吗?
提前致谢
【问题讨论】: