Suggestions

FIXED Top of Page Button

Submitted by Sparkks, , Thread ID: 5388

Thread Closed
30-06-2015, 11:41 PM
This post was last modified: 30-06-2015, 11:52 PM by Sparkks
#1
I'm always using the "go to top" button on the websites that I use, and I believe it would be great for this one, especially because we allow multiple nested quotes.

IMPORTANT: If you do not want to go through this entire tutorial, you can install a script called EAGER which is only a JavaScript file include install. It will add a 'scroll-to-top' button automatically. It has a couple other apps you can install with one-click! I really love Eager.

I'll add a tutorial so you don't need to do research if you'd like to implement it.

You can find this tutorial here.

Step 1:
Open your footer template and add the following code at the very beginning:
Code:
<script type="text/javascript">
jQuery.noConflict();
jQuery(function($) {
$("#backtop").hide();
$(window).scroll(function () {
  if ($(this).scrollTop() > 400) {
   $('#backtop').fadeIn(200);
  } else {
   $('#backtop').fadeOut(200);
  }
});
$('.go-top').click(function () {
  $('html,body').animate({
   scrollTop: 0
  }, 1000);
  return false;
});
});
</script>
...and at the end before two close </div> tags:
Code:
<div id='backtop'>
  <a class='go-top' href='#top' title='Back to Top'><img src="{$theme['imgdir']}/top.png" /></a>
</div>
Save your footer template.

Step 2:
Open global.css and add at the end:

Code:
#backtop {
  position: fixed;
  bottom: 50px;
  right: 10px;
  margin: 0;
  padding: 0;
  width: 36px;
  height: 36px;
  z-index: 100;
}

Step 3:
Upload this up button in your theme image directory:
[Image: attachment.php?aid=27311]

Remember to include jQ library in MyBB if it is already not. In headerinclude:
Code:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

RE: FIXED Top of Page Button

#2
This would be something interesting. Nice suggestion!

RE: FIXED Top of Page Button

#3
I'd love to have this added, would be super useful.
UID: 799 I'm an oldfag.

RE: FIXED Top of Page Button

#4
I got a button in my Keyboard to do it, but oh well, I don't really care if it's added.

RE: FIXED Top of Page Button

#5
it would be great if his is added :D .
tbh. Scrolling to top is not a big pain but umm
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |


RE: FIXED Top of Page Button

#6
Really helpful .thanks

RE: FIXED Top of Page Button

OP
#7
01-07-2015, 12:29 AM
Believer Wrote:
it would be great if his is added :D .
tbh. Scrolling to top is not a big pain but umm

I'm on a Surface pro 3 with their shitty keyboard... it's a pain for me.

RE: FIXED Top of Page Button

#8
01-07-2015, 12:41 AM
Sparkks Wrote:
01-07-2015, 12:29 AM
Believer Wrote:
it would be great if his is added :D .
tbh. Scrolling to top is not a big pain but umm

I'm on a Surface pro 3 with their shitty keyboard... it's a pain for me.

i know that feeling for sure. When you get laptop or something like that :3
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |


RE: FIXED Top of Page Button

#9
This is really easy lol. But thanks for sharing :3

RE: FIXED Top of Page Button

OP
This post was last modified: 01-07-2015, 01:28 AM by Sparkks
#10
01-07-2015, 01:27 AM
Kill Wrote:
This is really easy lol. But thanks for sharing :3

I know it's easy, I just wanted to make it easier.

30-06-2015, 11:49 PM
Day Wrote:
I'd love to have this added, would be super useful.

[Image: Shia-Labeouf-motivation-just-do-it.gif?t=1433428170]

Users browsing this thread: 5 Guest(s)