Guest User

Untitled

a guest
Sep 12th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. var td_more_articles_box = {
  2. is_box_visible:false,
  3. cookie:'',
  4. distance_from_top:400,
  5.  
  6. init: function init() {
  7.  
  8.  
  9. //read the cookie
  10. td_more_articles_box.cookie = td_read_site_cookie('td-cookie-more-articles');
  11.  
  12.  
  13. //setting distance from the top
  14. //if(!isNaN(parseInt(tds_more_articles_on_post_pages_distance_from_top)) && isFinite(tds_more_articles_on_post_pages_distance_from_top) && parseInt(tds_more_articles_on_post_pages_distance_from_top) > 0){
  15. var distanata_user = 60;//tds_more_articles_on_post_pages_distance_from_top;
  16. //td_more_articles_box.distance_from_top = parseInt(tds_more_articles_on_post_pages_distance_from_top);
  17. //} else {
  18. // td_more_articles_box.distance_from_top = 400;
  19. //}
  20.  
  21.  
  22. var available = jQuery(document).height();
  23. td_more_articles_box.distance_from_top = available * distanata_user/ 100;
  24.  
  25.  
  26.  
  27. //adding event to hide the box
  28. jQuery('.td-close-more-articles-box').click(function(){
  29.  
  30. //hiding the box
  31. jQuery('.td-more-articles-box').removeClass('td-front-end-display-block');
  32. jQuery('.td-more-articles-box').hide();
  33.  
  34. //cookie life
  35. if(!isNaN(parseInt(tds_more_articles_on_post_time_to_wait)) && isFinite(tds_more_articles_on_post_time_to_wait)){
  36. //setting cookie
  37. td_create_cookie('td-cookie-more-articles', 'hide-more-articles-box', parseInt(tds_more_articles_on_post_time_to_wait));
  38. }
  39. });
  40. },
Advertisement
Add Comment
Please, Sign In to add comment