Facebook
From Carlos, 9 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 616
  1. function update(event, ui) {
  2.   var am;
  3.   if (jQuery(event.target).is(jQuery("#slider")))
  4.     am = ui.value;
  5.   else
  6.     am = jQuery("#slider").slider("value");
  7.  
  8.   var da;
  9.   if (jQuery(event.target).is(jQuery("#sliderr")))
  10.     da = ui.value;
  11.   else
  12.     da = jQuery("#sliderr").slider("value");
  13.  
  14.   jQuery( "#amount" ).text( "£" + am );
  15.   jQuery( ".loanamount" ).text(am + "£");
  16.   jQuery( "#ilezaplacic" ).text(am + "£");
  17.   jQuery( "#ilezaplacicc" ).text(am + "£");
  18.  
  19.   jQuery("#amountt").text(da + "days");
  20.   jQuery(".dnidosplaty").text(da + " days");
  21.   //Wonga
  22.   if (am > 400 || da > 38) {
  23.     jQuery( "#loanamountwonga" ).text("max.400£");
  24.     jQuery( "#dosplatywonga" ).text("max.");
  25.     jQuery("#interestwonga").text("max.");
  26.     jQuery("#dnidosplatywonga").text("max. 38days");
  27.   } else {
  28.  
  29.     jQuery("#interestwonga").text( (0.008 * am * da).toFixed(2) + "£");
  30.     jQuery( "#loanamountwonga" ).text((am ).toFixed(2) + "£");
  31.     jQuery("#dosplatywonga").text( (am + 0.008 * am * da).toFixed(2) + "£");
  32.     jQuery("#dnidosplatywonga").text(da + " days");
  33.   }
  34.  
  35. //Wageme
  36.   if (am > 750) {
  37.      jQuery( "#loanamountwageme" ).text("max.750£");
  38.     jQuery( "#dosplatywageme" ).text("max.");
  39.     jQuery("#interestwageme").text("max.");
  40.    
  41.   } else {
  42.  
  43. jQuery("#interestwageme").text( (0.24 * am ).toFixed(2) + "£");
  44. jQuery( "#dosplatywageme" ).text((am + 0.24 * am).toFixed(2) + "£");
  45. jQuery( "#loanamountwageme" ).text(am + "£");
  46.     }
  47.  
  48. //quickloanshop
  49.   if (am > 500) {
  50.      jQuery( "#loanamountquickloanshop" ).text("max.500£");
  51.     jQuery( "#dosplatyquickloanshop" ).text("max.");
  52.     jQuery("#interestquickloanshop").text("max.");
  53.    
  54.   } else {
  55.  
  56. jQuery("#interestquickloanshop").text( (0.24 * am ).toFixed(2) + "£");
  57. jQuery( "#dosplatyquickloanshop" ).text((am + 0.24 * am).toFixed(2) + "£");
  58. jQuery( "#loanamountquickloanshop" ).text(am + "£");
  59.     }
  60.  
  61. // Invalidate DataTable cells:
  62. jQuery("#tablepress-3").DataTable().rows().invalidate().draw();
  63.  
  64. }
  65.  
  66. jQuery(function() {
  67.   jQuery( "#slider" ).slider({
  68.     range: "min",
  69.     min: 50,
  70.     max: 800,
  71.     value: 150,
  72.     step: 1,
  73.     slide: update,
  74.   });
  75.  
  76.   jQuery( "#sliderr" ).slider({
  77.     range: "min",
  78.     min: 1,
  79.     max: 60,
  80.     value: 15,
  81.     step: 1,
  82.     slide: update,
  83.   });
  84.  
  85. // Ustawienie początkowych wartości:
  86. jQuery( "#amount" ).text( jQuery( "#slider" ).slider( "value" ) );
  87. jQuery( ".loanamount" ).text( jQuery( "#slider" ).slider( "value" ) + "£" );
  88. jQuery( ".dnidosplaty" ).text( jQuery( "#sliderr" ).slider( "value" ) + " days");
  89. });
  90.  
  91. function showDiv() {
  92.   document.getElementById('welcomeDiv').style.display = "block";
  93. }