Changeset 23233


Ignore:
Timestamp:
Jun 15, 2013, 6:49:38 PM (11 years ago)
Author:
flop25
Message:

bug:2923
adding js to fix the "Add acomment" div when scrolling

Location:
trunk/themes/elegant
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/elegant/scripts_pp.js

    r13730 r23233  
    156156       
    157157        }
    158        
     158 
     159  var top = jQuery('#commentAdd').offset().top - parseFloat(jQuery('#commentAdd').css('marginTop').replace(/auto/, 0));
     160  jQuery(window).scroll(function (event) {
     161    // what the y position of the scroll is
     162    var y = jQuery(this).scrollTop();
     163 
     164    // whether that's below the form
     165    if (y >= top) {
     166      // if so, ad the fixed class
     167      jQuery('#commentAdd').addClass('fixed');
     168    } else {
     169      // otherwise remove it
     170      jQuery('#commentAdd').removeClass('fixed');
     171    }
     172  });
     173
    159174       
    160175});
  • trunk/themes/elegant/theme.css

    r21173 r23233  
    257257        font-size: 100%;
    258258}
    259 
     259#commentAdd.fixed {  position: fixed; top: 10px; }
    260260#pictureCommentList .commentsOrder      { float: left; margin-bottom: 5px;}
    261261#pictureCommentList .navigationBar      { float: right; margin-bottom: 5px;}
Note: See TracChangeset for help on using the changeset viewer.