Changeset 31893
- Timestamp:
- Oct 1, 2017, 10:30:19 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/MenuRandomPhoto/mrp.js
r31892 r31893 4 4 return; 5 5 6 <<<<<<< .mine7 6 $('#imrp_ill0').width(MRP_blockHeight); 8 7 $('#imrp_ill0').height(MRP_blockHeight); 9 ||||||| .r3179310 var randomPict = MRP_Opt['pictures'];11 if (randomPict.length > 1) {12 $('#imrp_ill0 a').attr("href", randomPict[0]['link']);13 $('#imrp_ill0 img').attr("src", randomPict[0]['thumb']);14 =======15 var randomPict = MRP_Opt['pictures'];16 if (randomPict.length > 1 && $("#mbRandomPhoto").length > 0) {17 $('#imrp_ill0 a').attr("href", randomPict[0]['link']);18 $('#imrp_ill0 img').attr("src", randomPict[0]['thumb']);19 >>>>>>> .r3189120 8 21 9 var randomPict = MRP_Opt['pictures']; 22 if (randomPict.length > 1 )10 if (randomPict.length > 1 && $("#mbRandomPhoto").length > 0) 23 11 { 24 12 $('#imrp_ill0 a').attr("href", randomPict[0]['link']); 25 13 $('#imrp_ill0 img').attr("src", randomPict[0]['thumb']); 26 14 27 var nextFaderPos = 1; 28 var duration = 400; 29 var pause = false; 15 var randomPict = MRP_Opt['pictures']; 16 if (randomPict.length > 1) 17 { 18 $('#imrp_ill0 a').attr("href", randomPict[0]['link']); 19 $('#imrp_ill0 img').attr("src", randomPict[0]['thumb']); 30 20 31 $('#imrp_ill0 img').after('<img id="irmbRPicImg">'); 32 $('#imrp_ill0 img').eq(1).hide(); 33 $('#imrp_ill0 img')[1].src = randomPict[1]['thumb']; 34 $('#imrp_ill0 img').css('position', 'absolute'); 21 var nextFaderPos = 1; 22 var duration = 400; 23 var pause = false; 35 24 36 $('#imrp_ill0').hover(function() { pause = true; },function() { pause = false; }); 25 $('#imrp_ill0 img').after('<img id="irmbRPicImg">'); 26 $('#imrp_ill0 img').eq(1).hide(); 27 $('#imrp_ill0 img')[1].src = randomPict[1]['thumb']; 28 $('#imrp_ill0 img').css('position', 'absolute'); 37 29 38 function doRotate()39 { 40 if ($('#imrp_ill0 img')[1].complete)30 $('#imrp_ill0').hover(function() { pause = true; },function() { pause = false; }); 31 32 function doRotate() 41 33 { 42 if (!pause)34 if ($('#imrp_ill0 img')[1].complete) 43 35 { 44 $('#imrp_ill0 img').first().fadeOut(duration, function() { 45 nextFaderPos = (nextFaderPos + 1) % randomPict.length; 46 $('#imrp_ill0 img')[1].src = randomPict[nextFaderPos]['thumb']; 47 }); 48 $('#imrp_ill0 img').first().insertAfter($('#imrp_ill0 img').eq(1)); // swap 49 $('#imrp_ill0 img').first().fadeIn(duration); 50 setTimeout(function() { 51 $('#imrp_ill0 a').attr("href", randomPict[nextFaderPos]['link']); 52 }, duration/3); 36 if(!pause) 37 { 38 $('#imrp_ill0 img').first().fadeOut(duration, function() { 39 nextFaderPos = (nextFaderPos + 1) % randomPict.length; 40 $('#imrp_ill0 img')[1].src = randomPict[nextFaderPos]['thumb']; 41 }); 42 $('#imrp_ill0 img').first().insertAfter($('#imrp_ill0 img').eq(1)); // swap 43 $('#imrp_ill0 img').first().fadeIn(duration); 44 setTimeout(function() { 45 $('#imrp_ill0 a').attr("href", randomPict[nextFaderPos]['link']); 46 }, duration/3); 47 } 53 48 } 54 49 } 50 51 var rotate = setInterval(doRotate, MRP_delay); 55 52 } 56 57 var rotate = setInterval(doRotate, MRP_delay);58 53 } 59 54 });
Note: See TracChangeset
for help on using the changeset viewer.