Changeset 26086 for trunk/themes/elegant/scripts_pp.js
- Timestamp:
- Dec 22, 2013, 5:31:56 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/elegant/scripts_pp.js
r26084 r26086 54 54 function commentsToggle() { 55 55 if (comments.hasClass("commentshidden")) { 56 57 58 56 comments.removeClass("commentshidden").addClass("commentsshown"); 57 comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");; 58 session_storage['comments'] = 'visible'; 59 59 60 comments_top_offset = comments_add.offset().top - parseFloat(comments_add.css('marginTop').replace(/auto/, 0)); 61 } 62 else { 63 comments.addClass("commentshidden").removeClass("commentsshown"); 64 comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");; 65 session_storage['comments'] = 'hidden'; 66 } 60 comments_top_offset = comments_add.offset().top - parseFloat(comments_add.css('marginTop').replace(/auto/, 0)); 61 } 62 else { 63 comments.addClass("commentshidden").removeClass("commentsshown"); 64 comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");; 65 session_storage['comments'] = 'hidden'; 66 comments_top_offset = 0; 67 } 67 68 } 68 69 … … 144 145 if (comments_top_offset==0) return; 145 146 146 // what the y position of the scroll is147 147 var y = jQuery(this).scrollTop(); 148 148 149 // whether that's below the form150 149 if (y >= comments_top_offset) { 151 // if so, ad the fixed class 152 comments_add.addClass('fixed'); 150 comments_add.css({ 151 'position': 'absolute', 152 'top': y-comments.offset().top+10 153 }); 153 154 } 154 155 else { 155 // otherwise remove it 156 comments_add.removeClass('fixed'); 156 comments_add.css({ 157 'position': 'static', 158 'top': 0 159 }); 157 160 } 158 161 });
Note: See TracChangeset
for help on using the changeset viewer.