节点不能插入层次结构中的指定点“代码:“3 [英] Node cannot be inserted at the specified point in the hierarchy" code: "3
问题描述
嘿,这是关于jquery和 gridlayout 的问题再次提出我我做了一个php带开关的模板和我插入的代码是这个
Hey, it's me again with a question about jquery and that gridlayout I made a php template with switch and the code i am inserting is this
<div id="wrapper">
<div id="grid">
<div class="box"><img src="img/an_005_BUR_thebeat.jpg" width="310px" height="438px" />3 index</div>
<div class="box"><img src="img/an_014_GUE_homme_a.jpg" width="310px" height="404px" />4 Culture</div>
<div class="box"><img src="img/an_044_BVL_springmotiv.jpg" width="310px" height="310px" />5 Pharma</div>
<div class="box"><img src="img/an_039_AN_diskette.jpg" width="310px" height="465px" />6 Pharma IT</div>
<div class="box"><img width="310px" height="100px" />7 Culture</div>
<div class="box"><img width="310px" height="120px" />8 Cosmetics</div>
<div class="box"><img width="310px" height="400px" />9 IT</div>
<div class="box"><img width="310px" height="400px" />10 Culture</div>
<div class="box"><img width="310px" height="400px" />11 IT</div>
<div class="box"><img width="310px" height="400px" />12 Culture</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#grid').gridLayout('.box', {col_width: 340, min_cols: 2});
// options - (values above are the defaults)
// col_width: the width of each grid block
// min_cols: the minimum number of cols on the page (reducing browser width below this will not decrease number of columns). Set to your largest block (3 = block spans 3 columns)
// gridLayout.placeAtEnd() - for placing a block at bottom right of grid
var final_block = $('');
$('#grid').gridLayout.placeAtEnd( final_block );
// gridchange event fires when window resize forces a grid refresh
$('#grid').bind( "gridchange", function(e){
console.log('gridchange event fired');
// reposition the final block
$('#grid').gridLayout.placeAtEnd( final_block );
});
// this forces a redraw of grid
$('body').gridLayout.refresh();
// returns heights of each column
console.log( 'gridLayout.info():', $('#grid').gridLayout.info() );
});
</script>
jquery脚本和插件都加载在标题中。当我试图运行这个。 Firebug告诉我:
The jquery script and the plugin are loaded in the header. When i try to run this. Firebug tells me:
无法在层次结构中的指定点插入节点代码:3
"Node cannot be inserted at the specified point in the hierarchy" code: "3"
有人知道如何解决这个问题吗?
Do anybody know how to fix this?
这是我加载的一个例子: http://18735.webhosting7.1blu.de/neu/index.php?item=lifestyle
Here is an example i loaded up: http://18735.webhosting7.1blu.de/neu/index.php?item=lifestyle
推荐答案
我很确定你的错误是以下内容。什么是$('')!
I am pretty sure your error is with the following. What is $('') !
var final_block = $('');
$('#grid').gridLayout.placeAtEnd( final_block );
如果我说
var final_block = $('<div />');
$('#grid').gridLayout.placeAtEnd( final_block );
这篇关于节点不能插入层次结构中的指定点“代码:“3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!