Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src='http://code.jquery.com/jquery-latest.js' type='text/javascript'></script>
- <b:if cond='data:blog.pageType == "item"'>
- <script type='text/javascript'>
- //<![CDATA[
- if(typeof jQuery != 'undefined') {
- $(function() {
- $('a.smoothvscroll').bind('click',function(event){
- var $anchor = $(this);
- $('html, body').stop().animate({
- scrollTop: $($anchor.attr('href')).offset().top
- }, "slow");
- event.preventDefault();
- });
- });
- }
- // functions for show/hide comments
- function showhideElm(ele, showhide) {
- if(!ele) return;
- if(showhide == "toggle") {
- if(typeof jQuery == 'undefined')
- {
- if(ele.style.display != "none")
- ele.style.display = "none";
- else
- ele.style.display = "block";
- }
- else
- $(ele).slideToggle();
- }
- else if(showhide == "hide")
- {
- if(typeof jQuery == 'undefined')
- ele.style.display = "none";
- else
- $(ele).slideUp("slow");
- }
- else if(showhide == "show")
- {
- if(typeof jQuery == 'undefined')
- ele.style.display = "block";
- else
- $(ele).slideDown("slow");
- }
- }
- function toggleComment(event, elm)
- {
- var txt='';
- if (window.getSelection)
- txt = window.getSelection();
- else if (document.getSelection)
- txt = document.getSelection();
- else if (document.selection)
- txt = document.selection.createRange().text;
- var target = event.target ? event.target : event.srcElement;
- if (target.nodeType != 1)
- target = target.parentNode;
- if (target.nodeName.toLowerCase() == 'a' || target.nodeName.toLowerCase() == 'img' || txt != '')
- return;
- elm=getCommentBodyElm(elm);
- showhideElm(elm, "toggle");
- }
- function getCommentBodyElm(elm)
- {
- if(elm.className=="admin-comment" || elm.className=="normal-comment")
- elm=elm.firstChild;
- while(elm && (elm.nodeType != 1 || (elm.className != "comment-body" && elm.className != "comment-body-author")))
- elm = elm.nextSibling;
- return elm;
- }
- function showhideComments(showhide)
- {
- var elements = document.getElementsByTagName("*");
- for(var i=0 ; i<elements.length ; i++)
- if(elements[i].className=="normal-comment" || elements[i].className=="admin-comment")
- showhideElm(getCommentBodyElm(elements[i]), showhide);
- }
- function showComments()
- {
- showhideComments("show");
- return true;
- }
- function hideComments()
- {
- showhideComments("hide");
- return true;
- }
- //]]>
- </script>
- </b:if>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement