how can i get the webkit-column-count value and current page or column Id?
I am developing application using webview in android. i am loading a page into webview and splitting multiple columns dynamically using CSS3 webkit property. once user reach the last page/col开发者_运维知识库umn i have to show the TOC confirmation dialog. can anyone please advice me how to do that ?
height:600px;
-webkit-column-width:600px;
-webkit-column-count:auto;
How your TOC confirmation dialog is setup?
One possible solution could be to use the :nth-last-of-type(N) selector to select last page/column element http://reference.sitepoint.com/css/pseudoclass-nthlastoftype.
Try putting a small element at the end of the text, and then wait for it to appear on screen. It is easily done using jQuery with jquery-appear.
I forked @visualidiot's jsfiddle to create an example using said techniques. Haven't tested it using jQuery Mobile though.
- I put a
<span>
element at the end of the text. The span is floated right to make sure (most of) the last column is shown. In this example, the<span>
is not empty (and highly visible), but it would be better if it was just empty. - The javascript
confirm()
dialog screws up the scrolling a bit by locking mouse focus on the scroll slider (tested in Chrome 16 on Windows). Showing a confirm dialog in HTML would not. - Since
.appear()
works for vertical scrolling as well, this degrades nicely when not having-webkit-column-*
available (tested using IE9).
Get the total width of your element, and divide it by the width of a single column. Here's an example: http://jsfiddle.net/Ecp9M/
精彩评论