如何获取特定css列的内容 [英] How to get content of a specific css column
本文介绍了如何获取特定css列的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对我的英语很抱歉。
我使用css多栏布局,有办法获取特定栏的内容,或如何找到
< title>多列布局< / title>
< style type =text / css>
div.foo {
-webkit-column-count:2;
-moz-column-count:2;
}
< / style>
< body>
< div class =foo>
< script>
var i = 30,s = [];
while(i--){
s.push('< p> Lorem ipsum dolor sit amet,consectetur adipiscing'
+'elit。in magna arcu,condimentum a temporal vel, '
+'imperdiet nec lacus。Vestibulum iaculis arcu et justo'
+'suscipit non pharetra sem pulvinar。Suspendisse nec'
+'enim non dolor fringilla blandit。< \ / p> ;');
}
document.write(s.join(''));
< / script>
< / div>
< / body>
解决方案
b
将ID添加到每个列,并添加一个类。然后,您可以添加处理程序以获取任何行的ID。
Sorry for my English.
I'm using css multi-column layout , is there a way to get content of a specific column , or how to find the index of the string where sperate the columns.
<title>Multi-column Layout</title>
<style type="text/css">
div.foo {
-webkit-column-count: 2;
-moz-column-count: 2;
}
</style>
<body>
<div class="foo">
<script>
var i = 30, s = [];
while (i--) {
s.push('<p>Lorem ipsum dolor sit amet, consectetur adipiscing'
+ ' elit. In magna arcu, condimentum a tempor vel,'
+ ' imperdiet nec lacus. Vestibulum iaculis arcu et justo'
+ ' suscipit non pharetra sem pulvinar. Suspendisse nec'
+ ' enim non dolor fringilla blandit.<\/p>');
}
document.write(s.join(''));
</script>
</div>
</body>
解决方案
Easy solution here.
Add the ID to each column, and add a class. Then you can can add a handler to get the id of any row.
这篇关于如何获取特定css列的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文