Facebook
From Carlos, 9 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 596
  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.     jQuery("#tablepress-3 tbody .row-2").hide();
  28.   } else {
  29.  
  30.     jQuery("#interestwonga").text( (0.008 * am * da).toFixed(2) + "£");
  31.     jQuery( "#loanamountwonga" ).text((am ).toFixed(2) + "£");
  32.     jQuery("#dosplatywonga").text( (am + 0.008 * am * da).toFixed(2) + "£");
  33.     jQuery("#dnidosplatywonga").text(da + " days");
  34.     jQuery("#tablepress-3 tbody .row-2").show();
  35.   }
  36.  
  37. //Wageme
  38.   if (am > 750) {
  39.      jQuery( "#loanamountwageme" ).text("max.750£");
  40.     jQuery( "#dosplatywageme" ).text("max.");
  41.     jQuery("#interestwageme").text("max.");
  42.    
  43.   } else {
  44.  
  45. jQuery("#interestwageme").text( (0.24 * am ).toFixed(2) + "£");
  46. jQuery( "#dosplatywageme" ).text((am + 0.24 * am).toFixed(2) + "£");
  47. jQuery( "#loanamountwageme" ).text(am + "£");
  48.     }
  49.  
  50. //quickloanshop
  51.   if (am > 500) {
  52.      jQuery( "#loanamountquickloanshop" ).text("max.500£");
  53.     jQuery( "#dosplatyquickloanshop" ).text("max.");
  54.     jQuery("#interestquickloanshop").text("max.");
  55.    
  56.   } else {
  57.  
  58. jQuery("#interestquickloanshop").text( (0.24 * am ).toFixed(2) + "£");
  59. jQuery( "#dosplatyquickloanshop" ).text((am + 0.24 * am).toFixed(2) + "£");
  60. jQuery( "#loanamountquickloanshop" ).text(am + "£");
  61.     }
  62.  
  63. // Invalidate DataTable cells:
  64. jQuery("#tablepress-3").DataTable().rows().invalidate().draw();
  65.  
  66. }
  67.  
  68. jQuery(function() {
  69.   jQuery( "#slider" ).slider({
  70.     range: "min",
  71.     min: 50,
  72.     max: 800,
  73.     value: 150,
  74.     step: 1,
  75.     slide: update,
  76.   });
  77.  
  78.   jQuery( "#sliderr" ).slider({
  79.     range: "min",
  80.     min: 1,
  81.     max: 60,
  82.     value: 15,
  83.     step: 1,
  84.     slide: update,
  85.   });
  86.  
  87. // Ustawienie początkowych wartości:
  88. jQuery( "#amount" ).text( jQuery( "#slider" ).slider( "value" ) );
  89. jQuery( ".loanamount" ).text( jQuery( "#slider" ).slider( "value" ) + "£" );
  90. jQuery( ".dnidosplaty" ).text( jQuery( "#sliderr" ).slider( "value" ) + " days");
  91. });
  92.  
  93. function showDiv() {
  94.   document.getElementById('welcomeDiv').style.display = "block";
  95. }