Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is why we moved from prototype to jQuery
- FastInit.addOnLoad(function()
- {
- $$('#body_content_left_content', '#body_content_right_content').each(function(content){
- // it's okay if the first and last descendant are the same
- descendants = content.descendants().select(function(d){return d.tagName == "P"})
- if ((first_descendant = descendants.first()) != null) { first_descendant.addClassName('first_paragraph'); }
- if ((last_descendant = descendants.last()) != null) { last_descendant.addClassName('last_paragraph'); }
- });
- });
- //becomes:
- $(document).ready(function(){
- $('#body_content_left_content p:first, #body_content_right_content p:first').addClass('first_paragraph');
- });
Add Comment
Please, Sign In to add comment