Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <h2 class="o_hidden assessment-title">
  2.     <span class="left">Individual Writing Assessment Class Record</span>
  3. </h2>
  4.  
  5. <div class="report-container">
  6.     <table class="report-ss individual-writing-assessment" style="width:100%">
  7.         <thead>
  8.             <tr>
  9.                 <th class="to_the_center title-row fixed-column" rowspan="2">Student Name</th>
  10.                 <th colspan="{{assessmentsCount}}" class="to_the_center title-row">Overall Unit Score</th>
  11.             </tr>
  12.             <tr>
  13.                 {{#assessments}}
  14.                     <th class="ten">{{name}}</th>
  15.                 {{/assessments}}
  16.             </tr>
  17.         </thead>
  18.         <tbody>
  19.             {{#students}}
  20.             <tr>
  21.                 <td class="student">{{name}}</td>
  22.                 {{#scores}}
  23.                     <td>{{score}} {{assessmentTotal}}</td>
  24.                 {{/scores}}
  25.             </tr>
  26.             {{/students}}
  27.         </tbody>
  28.     </table>
  29. </div>
  30.  
  31. <script type="text/javascript">
  32. ;(function($) {
  33.    $.fn.fixMe = function() {
  34.       return this.each(function() {
  35.          var $this = $(this),
  36.             $t_fixed;
  37.          function init() {
  38.             $this.wrap('<div class="container" />');
  39.             $t_fixed = $this.clone();
  40.             $t_fixed.find("tbody").remove().end().addClass("fixed").insertBefore($this);
  41.             resizeFixed();
  42.          }
  43.          function resizeFixed() {
  44.             $t_fixed.find("th").each(function(index) {
  45.                $(this).css("width",$this.find("th").eq(index).width()+1+"px");
  46.             });
  47.          }
  48.          function scrollFixed() {
  49.             var offset = $(this).scrollTop(),
  50.             tableOffsetTop = $this.offset().top,
  51.             tableOffsetBottom = tableOffsetTop + $this.height() - $this.find("thead").height();
  52.             if(offset < tableOffsetTop || offset > tableOffsetBottom)
  53.                $t_fixed.hide();
  54.             else if(offset >= tableOffsetTop && offset <= tableOffsetBottom && $t_fixed.is(":hidden")){
  55.                $t_fixed.show();
  56.             }
  57.             $t_fixed.css('top', offset);
  58.          }
  59.          $(window).resize(resizeFixed);
  60.          $(window).scroll(scrollFixed);
  61.          $(window).touchmove(scrollFixed);
  62.          init();
  63.       });
  64.    };
  65. })(jQuery);
  66.  
  67. $(document).ready(function(){
  68.    $("table").fixMe();
  69.    $(".up").click(function() {
  70.       $('html, body').animate({
  71.       scrollTop: 0
  72.    }, 2000);
  73.  });
  74. });
  75.  
  76. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement