Response title
This is preview!




I also have 2-3 thumbnails photos on the page that when the user click on one of them the small thumbnail photo turn to be the mainPhoto.<img id='mainPhoto' src='../image/items/page1.jpg' style='position: relative; margin-left: auto; margin-right: auto; margin-top: -15px;'/>
And this is the jQuery code:<a href='../image/items/page1_01.jpg' data-ajax='false' class='thumbnail'><img src='../image/items/page_01.jpg'/></a>
<a href='../image/items/page1_02.jpg' data-ajax='false' class='thumbnail'><img src='../image/items/page_02.jpg'/></a>
Everything works great and the swapping of the photos is working on all the pages and photos.$(document).ready(function(){
$('.thumbnail').click(function(){
var mainImage = $(this).attr("href"); //Find Image Name
$("#mainPhoto").attr({ src: mainImage });
return false;
});
});
You've been given the solution twice.Any suggestions to solve this problem?
Big yellow box, top of the page:$(document).ready(function(){
http://jquerymobile.com/demos/1.2.0/docs/api/events.html
I suggest reviewing the jQuery Mobile documentation, at least the first few pages. You need to
to understand how jQuery Mobile loads pages using AJAX.
Much better to use .delegate() or .on(), BTW, since .live() is essentially obsolete (unless you have to use jQuery 1.6.4 or older) and much slower.$('div[data-role="page"]').live( 'pageinit',function(event){
© 2012 jQuery Foundation
Sponsored by
and others.
