Changeset 10863 for extensions/akBookStyle/trunk/js/ak_jquery-load.js
- Timestamp:
- May 13, 2011, 11:03:34 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/akBookStyle/trunk/js/ak_jquery-load.js
r10853 r10863 1 $(function 1 $(function() { 2 2 next_link = $('table.thumbnails div.navbar a[rel=next]'); 3 if (next_link.length !=0) {4 $('#akNextPicture').css('visibility', 'visible')3 if (next_link.length!=0) { 4 $('#akNextPicture').css('visibility', 'visible'); 5 5 } 6 6 previous_link = $('table.thumbnails div.navbar a[rel=previous]'); 7 if (previous_link.length !=0) {8 $('#akPreviousPicture').css('visibility', 'visible')7 if (previous_link.length!=0) { 8 $('#akPreviousPicture').css('visibility', 'visible'); 9 9 } 10 $("a.load").bind(ak_mouse_event, function () { 11 $('table.thumbnails tr td.ncol').each(function () { 12 if ($(this).hasClass('selected')) { 13 $(this).removeClass('selected') 10 11 $("a.load") 12 .bind(ak_mouse_event, function() { 13 $('table.thumbnails tr td.ncol').each(function() { 14 if ($(this).hasClass('selected')) { 15 $(this).removeClass('selected'); 16 } 17 }); 18 19 $a = $(this); 20 next_thumbnail = $('table.thumbnails a[href='+$(this).attr('href')+']'); 21 if (next_thumbnail.length==0) { 22 if ($a.attr('id')=='akNextPicture') { 23 rel = 'next'; 24 } else { 25 rel = 'previous'; 26 } 27 next_link = $('table.thumbnails div.navbar a[rel='+rel+']'); 28 if (next_link.length!=0) { 29 window.location = next_link.attr('href'); 14 30 } 15 }); 16 $a = $(this); 17 //next_thumbnail = $('table.thumbnails a[href=' + $(this).attr('href') + ']'); 18 next_thumbnail = $('table.thumbnails a'); 19 if (next_thumbnail.length == 0) { 20 if ($a.attr('id') == 'akNextPicture') { 21 rel = 'next' 22 } else { 23 rel = 'previous' 24 } 25 next_link = $('table.thumbnails div.navbar a[rel=' + rel + ']'); 26 if (next_link.length != 0) { 27 window.location = next_link.attr('href') 28 } 29 } else { 31 } else { 30 32 next_thumbnail.parent().parent().parent().addClass('selected'); 31 try { 32 $.get($a.attr('href'), {}, function success(data) { 33 $('#akPicture').attr('src', data.AK_PIC_SRC).attr('alt', data.AK_PIC_ALT).attr('title', data.AK_PIC_TITLE); 34 $('.ak_pic a').attr('href', data.AK_PIC_URL); 35 if (data.AK_PREVIOUS) { 36 $('#akPreviousPicture').removeClass('hide').attr('href', data.AK_PREVIOUS) 37 } else { 38 $('#akPreviousPicture').addClass('hide') 39 } 40 if (data.AK_NEXT) { 41 $('#akNextPicture').removeClass('hide').attr('href', data.AK_NEXT) 42 } else { 43 $('#akNextPicture').addClass('hide') 44 } 45 $a.click(function (e) { 46 e.preventDefault() 47 }) 48 }, 'json') 49 } catch (e) {} 50 } 51 return false 52 }) 53 }); 33 try { 34 $.get($a.attr('href'),{}, 35 function success(data) { 36 $('#akPicture') 37 .attr('src', data.AK_PIC_SRC) 38 .attr('alt', data.AK_PIC_ALT) 39 .attr('title', data.AK_PIC_TITLE); 40 41 if (data.AK_PREVIOUS) { 42 $('#akPreviousPicture') 43 .removeClass('hide') 44 .attr('href', data.AK_PREVIOUS); 45 } else { 46 $('#akPreviousPicture').addClass('hide'); 47 } 48 if (data.AK_NEXT) { 49 $('#akNextPicture') 50 .removeClass('hide') 51 .attr('href', data.AK_NEXT); 52 } else { 53 $('#akNextPicture').addClass('hide'); 54 } 55 $a.click(function(e) { e.preventDefault();}); 56 }, 57 'json'); 58 } catch (e) {} 59 } 60 return false; 61 }); 62 });
Note: See TracChangeset
for help on using the changeset viewer.