javascript - jquery mobile page with more button -
I'm showing more than 50 elements to AJ query mobile page, how to open only to show the first 10 Also the suggestion page, and another button on the bottom that can show all if click on it is my script:
& lt; Body & gt; & Lt; Div data-role = "page" data-add-back-btn = "correct" data-back-btn-text = "back" & gt; & Lt; Div data-role = "header" & gt; & Lt; H1 style = "white spot: normal" & gt; Body & lt; / H1> & Lt; / Div & gt; & Lt; Ul data-roll = "listview" data-inset = "true" data-filter = "wrong" & gt; & Lt; Li & gt; & Lt; A href = "http://www.mydomain.co.nz/users/262/" & gt; Feature listing & lt; / A & gt; & Lt; / Li & gt; & Lt; Ul data-roll = "list view" data-filter = "wrong" & gt; & Lt; Table & gt; & Lt; Li & gt; & Lt; A href = "/ user / 264 / properties / 50473" & gt; & Lt; Img src = "/ media / 2012/11/01 / 011528_47689.jpg? M = resize and [geometry] = 80x60 & amp; s = f9e49fbb929e8d1b" /> & Lt; H3 & gt; 7C / 1 9 2 Willis Street & lt; / Font & gt; & Lt; / Font & gt; & Lt; / Font & gt ;, Beijing & lt; / H3 & gt; & Lt; P & gt; Buyer checks exceeding $ 305,000 & lt; Br / & gt; Riff: 47689 & lt; / P & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "/ user / 264 / property / 50474" & gt; & Lt; Img src = "/ media / 2012/11/01 / 011533_47722.jpg? M = resize and [geometry] = 80x60 & s = b4482c7638c512b4" /> & Lt; H3 & gt; 606/35 Abel Smith Street & lt; / Font & gt; & Lt; / Font & gt; & Lt; / Font & gt ;, arrow arrow & lt; / H3 & gt; & Lt; P & gt; Tender & lt; Br / & gt; Riff: 47722 & lt; / P & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "/ user / 264 / listing / 50476" & gt; & Lt; Img src = "/ media / 2012/11/01 / 011539_47691.jpg? M = size & o [geometry] = 80x60 & amp; s = 66def46f1524e177" /> & Lt; H3 & gt; 8/34 William Street & lt; / Font & gt; & Lt; / Font & gt; & Lt; / Font>, Hataitai & lt; / H3 & gt; & Lt; P & gt; Buyer Inquiry More than $ 280,000 & lt; Br / & gt; Riff: 47691 & lt; / P & gt; & Lt; / A & gt; & Lt; / Li & gt; ........ ....... more than 50 elements
< P> You can try to use slices with your li elements and hide them. First of all, hide all of them with CSS: Li {display: none; } then show the first 10 in JavaScript, and click on the event listener to show hidden Set> People: $ ('li'). Piece (0, 10). CSS ('display', 'block'); $ ('# More-button') Click (function () {$ ('li: hidden'). Show ();});
Comments
Post a Comment