Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: user46159
Added: Jul 23, 2019 3:43 AM
Views: 14
Tags: no tags
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7.  
  8. $(function () {
  9.     $('[data-toggle="popover"]').popover({
  10.         html: true
  11.     });
  12.  
  13. })
  14.  
  15. $(document).ready(function () {
  16. //    $.fn.editable.defaults.mode = 'inline';
  17.     $('#username').editable();
  18.     $(document).on("click", ".home_product_list .media", function () {
  19.         $('.product_detail .product_image img').attr('src', $(this).find('img').attr('src'));
  20.         var this_product = $(this);
  21.  
  22.         $('.product_detail .product_des .product_name').html(this_product.data('name'));
  23.         var count = 1;
  24.         $('.product_detail .product_des').find('.product_att_value').each(function () {
  25.             if (count == 1) {
  26.                 $(this).html(this_product.data('code'));
  27.             }
  28.             if (count == 2) {
  29.                 $(this).html(this_product.data('local'));
  30.             }
  31.             if (count == 3) {
  32.                 $(this).html(this_product.data('person'));
  33.             }
  34.             if (count == 4) {
  35.                 $(this).html(this_product.data('time'));
  36.             }
  37.             if (count == 5) {
  38.                 $(this).html(this_product.data('status'));
  39.             }
  40.             count++;
  41.         });
  42.     });
  43.  
  44.     var window_size = $(window).height();
  45.     var window_nav = $('.box_product_history').offset().top;
  46.     var div_height = window_size - window_nav;
  47.     $('.box_product_history').height(div_height - 50);
  48.     $('.box_product_history').css('overflow', 'auto');
  49.     var window_home = $('.home_product_list').offset().top;
  50.     var home_height = window_size - window_home;
  51.     $('.home_product_list').height(home_height - 50);
  52.     $('.home_product_list').css('overflow', 'auto');
  53.  
  54.  
  55.     $('.modal-body .box_product_history').css('max-height', (window_size / 4 * 3) + 'px');
  56.       $('.modal-body .box_product_history').css('height', 'auto');
  57.     $('.modal-body .box_product_history').css('overflow', 'auto');
  58.  
  59. })