jQuery的直道里格? [英] Jquery backstretch inside div?
本文介绍了jQuery的直道里格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想才达到使用JQuery的div内的全屏背景图片。
I am trying to achive a fullscreen background image inside a div using JQuery.
我使用的是插件直道,其工作但它结合细图像身体标记。
I am using the Backstretch plugin, which works fine however it binds the image to the body tag.
我期待这跟home_middle_bg的ID,任何想法?
I am looking to apply this to a div with the id of home_middle_bg, any ideas?
感谢
推荐答案
其实图像绑定到一个div那就是ppended身体$ P $:您可以通过更换(第69行的插件修改它的手):
Actually the image is binded to a div and that is prepended to the body: you could modify it by hand by replacing (line 69 of the plugin):
if($("body #backstretch").length == 0) {
$("body").prepend(container);
}
与
if($("#home_middle_bg #backstretch").length == 0) {
$("body").prepend(container);
}
这篇关于jQuery的直道里格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文