The script is called "jQuery Scroll to Top Control v1.1", from here --> http://www.dynamicdrive.com/dynamicindex3/scrolltop.htm
I've put it on my website, it works well --> http://www.ajwan.net/
I can't manage to make it work on my forum because I don't know
- in which folder I should put the file scrolltotop.js
- in which file I should put the script given on dynamicdrive.com (the one that goes between the <head> and </head> tags
Additional info : I use a custom template
Is someone could help, I'd be most grateful
Fran
Themes/theme_name/index.template.php is where the <head> tags are that you need to put the code in. You can put the scrolltotop.js file anywhere you want, as long as you link to it properly in the <script> tag.
I must do something wrong because it doesn't work...
I first tried the script without "echo" in front but on the forum page, I got the message "Template Parse Error!"
So I tried with "echo" in front. No error message anymore but no scroll up button either. Nothing. (Sorry, I'm a total zero with php)
This is the concerned part within the index.template.php of my custom theme. My addition starts just after <head>';
// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>';
echo '
// The script for scroll up
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="scrolltopcontrol.js">
/***********************************************
* Scroll To Top Control script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Project Page at http://www.dynamicdrive.com for full source code
***********************************************/
</script>';
As for the file scrolltopcontrol.js , I did put it within the custom theme folder too, and the image url in it (the scroll up button) should be fine since it's an absolute url, not relative. Anyway that same scrolltopcontrol.js file works on my website, so I don't think the problem is there.
Thanks for your attention, IchBin
You have a PHP comment (// The script for scroll up) inside an echo '';, remove both that comment and the /************ ... */ comment block.
Also, I did write a mod for this?
Still not working :(
Did I do it right ? Here's the code now :
<head>';
echo '
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="scrolltopcontrol.js">
</script>';
Lainaus käyttäjältä: Labradoodle-360 - marraskuu 12, 2012, 08:03:57 IP
Also, I did write a mod for this?
I did notice it but it doesn't say it's compatible with 2.0.2 and also, from what I see on your screencaps, it doesn't do the same as what I'm trying to achieve, I think. Your mod adds a link at the very bottom of the page, right ? With "jQuery Scroll to Top Control v1.1", the scroll up button is always visible, it follows the scroll movements of the page, like here --> http://www.ajwan.net
(forgive me if I misunderstood your mod)
I forgot to mention: with the code I just gave in previous post, it seems that it adds a padding-top to the body. My body background didn't move but he whole forum is displayd around 10px lower than it was... (???)
The forum is displaying "lower" because the padding is because of the anchor being a block-level element. So at least that part is "functioning". Be it unpleasantly or not.
Wasn't paying much attention early, had somewhat of a crazy night, so I apologize. Try putting the scripts in front of the closing head tag. (scripts...</head>).
Still not working that way. And now the padding at the top has disapeard (since you said that padding is a good thing, I gues now it's bad...)
Hey, what I'm trying to do is definitely not vital and I guess you expert guys are busy with more important stuff. I'm OK with forgetting about it if it's too tricky.
Hmm, are you able to PM me a link and some FTP access and I can get it setup for you?
Don't worry about it :) No problem with helping you.
Sure, I'll do that. Thank you very much, Labradoodle :)
You're welcome...don't be surprised if it's ~30 minutes before I get to it though. :)
Completed this for you.
Made one modification to Load.php:
detectBrowser();
//-- Dynamic Drive; Back to Top
$context['html_headers'] .= '
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/scrolltopcontrol.js">
/***********************************************
* Scroll To Top Control script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Project Page at http://www.dynamicdrive.com for full source code
***********************************************/
</script>
';
// End Dynamic Drive; Back to Top --//
- Added the .js file to ./Themes/default/scripts/
- Added the image to ./Themes/default/images/
- Modified scrolltopcontrol.js: fixing the image path, and adding an alt attribute to the img tag, fixing an XHTML validation issue.
It'll work with all themes out of the box. Enjoy.
Wow ! I love you, Labradoodle. That's wonderful ! :) :) :)
Also thanks for the tool info for changing my forum folder name. I'll definitely try that.
And yes, I'll change my ftp PW.
Thank youuuuuuuu
Fran
Not a problem, fran-! Glad I could help you out.
Here is a link to information on repair_settings: What is repair_settings.php? (http://wiki.simplemachines.org/smf/Repair_settings.php) which may be of use to you. It's definitely easy to do :)
Topic solved? I hope you have a wonderful night.
Labradoodle-360
Lainaus käyttäjältä: Labradoodle-360 - marraskuu 12, 2012, 11:32:26 IP
fixing an XHTML validation issue.
Please you can suggest me this modification of XHTML ?
i will be grateful thx