Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Create "Back to top" button using jQuery in one step. Details »»
Create "Back to top" button using jQuery in one step.
Version: 1.00, by xixxon xixxon is offline
Developer Last Online: Dec 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.2.0 Rating:
Released: 07-29-2012 Last Update: Never Installs: 81
Re-useable Code Translations  
No support by the author.

Demo: http://noct-test.blogspot.com/2011/01/ai-duong.html

Instruction:
Find template footer.

Insert at the end.

Code:
<style type='text/css'>
#bttop{border:1px solid #4adcff;background:#24bde2;text-align:center;padding:5px;position:fixed;bottom:35px;right:10px;cursor:pointer;display:none;color:#fff;font-size:11px;font-weight:900;}
#bttop:hover{border:1px solid #ffa789;background:#ff6734;}
</style>
<div id='bttop'>BACK TO TOP</div>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'></script>
<script type='text/javascript'>$(function(){$(window).scroll(function(){if($(this).scrollTop()!=0){$('#bttop').fadeIn();}else{$('#bttop').fadeOut();}});$('#bttop').click(function(){$('body,html').animate({scrollTop:0},800);});});</script>
Done. :up:
Hope you like it !

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
7 благодарности(ей) от:
davut_c20, dorans, elsa23, fxdigi-cash, Judith2, rodriiverduguez, seventhaxis

Comments
  #32  
Old 05-18-2014, 11:32 PM
betadoor betadoor is offline
 
Join Date: Sep 2010
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #33  
Old 05-19-2014, 05:14 AM
DemOnstar's Avatar
DemOnstar DemOnstar is offline
 
Join Date: Dec 2012
Posts: 859
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is good to play around with. Works as it should.
Reply With Quote
  #34  
Old 05-19-2014, 07:07 AM
AURFSCAN AURFSCAN is offline
 
Join Date: Dec 2007
Posts: 328
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use

Code:
<a href="{vb:raw relpath}#top" onclick="document.location.hash='top'; return false;"><font color="maroon"><b>{vb:rawphrase top}</b></font></a>
put it wherever you want, easy to replace the phrase with an image aswell


btw, without trying this one by xixxon what is it meant to do? scroll slowly or something??

Attached Images
File Type: jpg top.jpg (15.8 KB, 0 views)
Reply With Quote
  #35  
Old 05-19-2014, 03:52 PM
DemOnstar's Avatar
DemOnstar DemOnstar is offline
 
Join Date: Dec 2012
Posts: 859
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It does scroll slowly but I guess that can be changed.

I just like the effort the guy made and shared with all and sundry.

I am now using it with opacity and border radius. Looks ok and behaves well.

Cheers xixxon. I wish I could could be as inventive as you are.

I like this idea too but can't seem to get it visible. AURFSCAN
https://vborg.vbsupport.ru/showthread.php?t=311269
Reply With Quote
  #36  
Old 06-08-2014, 11:37 PM
AURFSCAN AURFSCAN is offline
 
Join Date: Dec 2007
Posts: 328
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok.. I like it, thx xixxon

I use existing stylevars to match forum style

add div code to footer but add css code to additional.css

border - forumhead border color and width
background - forumhead background color
hover background - footer background color or could be #color to suit eg. shades darker
padding - whatever looks good
border radius - browser compliant



Code:
#bttop {border:{vb:stylevar forumhead_border}; background:{vb:stylevar forumhead_background};
 text-align:center; padding:3px 9px 4px 10px; position:fixed; bottom:64px; right:0px; cursor:pointer; display:none; color:{vb:stylevar forumhead_color}; font-weight:bold; 
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-bottomleft: 5px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;}
#bttop:hover{border:{vb:stylevar forumhead_border}; background:{vb:stylevar footer_background}}
@demon, post in thread, i'll see if I can help
Attached Images
File Type: jpg 1.jpg (13.2 KB, 0 views)
File Type: jpg 2.jpg (13.8 KB, 0 views)
Reply With Quote
Благодарность от:
CharlieDelta
  #37  
Old 12-30-2019, 03:37 PM
MentorBR MentorBR is offline
 
Join Date: Jul 2019
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was needing this
In case I wanted to add a button that scrolls to the last post of a topic, I think it would be cool too
Reply With Quote
  #38  
Old 04-13-2023, 05:36 PM
oldfan's Avatar
oldfan oldfan is offline
 
Join Date: Jul 2004
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dont work with 4.2.6. php 7.2
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:04 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04642 seconds
  • Memory Usage 2,308KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (3)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete