- Timestamp:
- Jun 16, 2013, 8:20:19 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/elegant/scripts_pp.js
r23251 r23269 168 168 comments_button.click(function() { commentsToggle() }); 169 169 commentsswicther.click(function() { commentsToggle() }); 170 170 171 if (jQuery('#commentAdd').is(":visible")) { 172 var top = jQuery('#commentAdd').offset().top - parseFloat(jQuery('#commentAdd').css('marginTop').replace(/auto/, 0)); 173 jQuery(window).scroll(function (event) { 174 // what the y position of the scroll is 175 var y = jQuery(this).scrollTop(); 176 177 // whether that's below the form 178 if (y >= top) { 179 // if so, ad the fixed class 180 jQuery('#commentAdd').addClass('fixed'); 181 } else { 182 // otherwise remove it 183 jQuery('#commentAdd').removeClass('fixed'); 184 } 185 }); 186 } 171 187 } 172 188 173 var top = jQuery('#commentAdd').offset().top - parseFloat(jQuery('#commentAdd').css('marginTop').replace(/auto/, 0));174 jQuery(window).scroll(function (event) {175 // what the y position of the scroll is176 var y = jQuery(this).scrollTop();177 178 // whether that's below the form179 if (y >= top) {180 // if so, ad the fixed class181 jQuery('#commentAdd').addClass('fixed');182 } else {183 // otherwise remove it184 jQuery('#commentAdd').removeClass('fixed');185 }186 });187 189 188 190 … … 197 199 comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");; 198 200 jQuery.cookie('comments', 'visible', {path: "/"}); 201 var top = jQuery('#commentAdd').offset().top - parseFloat(jQuery('#commentAdd').css('marginTop').replace(/auto/, 0)); 202 jQuery(window).scroll(function (event) { 203 // what the y position of the scroll is 204 var y = jQuery(this).scrollTop(); 205 206 // whether that's below the form 207 if (y >= top) { 208 // if so, ad the fixed class 209 jQuery('#commentAdd').addClass('fixed'); 210 } else { 211 // otherwise remove it 212 jQuery('#commentAdd').removeClass('fixed'); 213 } 214 }); 215 199 216 } else { 200 217 comments.addClass("commentshidden").removeClass("commentsshown");
Note: See TracChangeset
for help on using the changeset viewer.