I am trying to figure out why I have to double click or tap to make thumbnails appear.
I have to tap or click twice for the thumbnails to display.
Here is my code:
html code:
- <div id="ThumbNails">
- <div id="thumbimg"></div>
- <div>
jquery code:
- $("#ThumbNails").bind("click", function (html) {
- lastShown = CurrentPage;
- PopulateThumbsEx(BookID, lastShown);
- //$("#book").fadeOut("fast");
- $(".ThumbNailNav").fadeIn(500);
- $("#thumbimg").empty();
- $("#thumbimg").append(html).prepend(thumbnails);
- $("#thumbimg").fadeIn(1000);
- });
My ajax code to get the images load them into a array.
- function PopulateThumbsEx(BookID, lastShown) {
- $.ajax({
- type: "POST", // AJAX type post
- url: "tabletbook.aspx/GetThumbNailPage",
- data: '{"BookID": "' + BookID + '", "lastShown": "' + lastShown + '"}',
- contentType: "application/json; charset=utf-8", //This is required or you will get all sorts of strange things :-)
- dataType: "json", //We need to specifiy JSON as to have the AJAX serialize the data between Client and server
- success: function (data) { // The msg that comes back has in it the d attribute which in this case contains an array from the server
- thumbnails = data.d; //Lets copy the thumbnails to a global array.
- }
- });
- }
It loads the images I just need for a one click or tap for the ipad and desktop.
any suggestion