Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
Hi, no problem with installation of BL 2.
What have I to change in this phplugin file, that it works again:
<?php function ttg_scripts( $style, $path ) {
echo '
<a href="#top" class="btn-scroll-to-top" title="Top of page" ><i class="fa fa-arrow-up fa-lg"></i></a>
<script>
$(document).ready(function() {
$(".btn-scroll-to-top").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
$(window).scroll(function() {
if ($(this).scrollTop() > 200) {
$(".btn-scroll-to-top").fadeIn();
} else {
$(".btn-scroll-to-top").fadeOut();
}
});
});
</script>
';
}
?>
Thanks, Rainer
Offline
Hi Rainer, see if this works. Note the addition of the class at the top and closing it at the bottom, the change of function name to just scripts, and the removal of the parameters passed to that function.
<?php
class PHPlugins extends APHPlugins
{
function scripts()
{
echo '
<a href="#top" class="btn-scroll-to-top" title="Top of page" ><i class="fa fa-arrow-up fa-lg"></i></a>
<script>
$(document).ready(function() {
$(".btn-scroll-to-top").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
$(window).scroll(function() {
if ($(this).scrollTop() > 200) {
$(".btn-scroll-to-top").fadeIn();
} else {
$(".btn-scroll-to-top").fadeOut();
}
});
});
</script>
';
}
}
?>
Offline
Thank you Ben, I am no programmer and I have no knowledge about phplugins.
Works !!!
Rainer
Offline
Offline
Ben,
I join Rainer in thanking you. I followed the changes shown in your post and now my own phplugin file is now working.
Barry
Offline
Offline
Hi Ben,
I have now arrived at Backlight 2 and am trying to take over the already working settings from Pangolin (version 1.2.3).
Like Rainer, I also had the "Scroll-to-top-button" installed in the old version, which didn't work after the update.
With your code I get the arrow displayed, but unfortunately only at the bottom left when I have reached the end of the page.
On the Pangolin page the arrow already appeared when the upper edge disappeared. I also adjusted the arrow with my custom.css.
Unfortunately I can't get the change with my custom.css. Although I have already tested some things. With the Inspector I have to practise a bit first to find the right selector again, because it has obviously changed.
Will I be able to do the same as in Pangolin in Backlight 2? Here are my custom.css:
/* ----- Scroll to top button styling ----- */
/* ======================================== */
.btn-scroll-to-top {
background-color: transparent;
display: none;
position: fixed;
bottom: 7px;
right: 15px;
border: 1px solid;
height: 32px;
width: 32px;
border-radius: 50%;
text-align: center;
line-height: 29px;
vertical-align: middle;
text-decoration: none;
color:#6f7c80;
}
.btn-scroll-to-top:hover {
text-decoration: none;
color:#ff0000;
border-color: red;
}
a.btn-scroll-to-top {
z-index: 3;
}
and the links to the Pangolin Page: https://backlight.der-canonier.de/ausruestung/
and Backlight 2 - page: https://pangolin.der-canonier.de/ausruestung/
I would be happy to receive tips.
Many greetings
Markus
https://www.mc-photografie.de - Backlight 3
https://bl3.mc-photografie.de - Backlight 3 Testsite
http://backup.der-canonier.de - Backlight 2
Offline
Hi Markus,
there appears to be an error in your custom css file.
Look at lines 57 to 62. There you have a portion of the code commented out. Line 57 starts with /* and line 62 ends with */. But in between there are other sections commented out (for example, /* IE6-9 */) and when that close comment after IE6-9 is encountered, it ends the commented section begun on line 57.
In the inspector, when I deleted lines 57 -62, the scroll-top button appeared where it should be.
So either remove lines 57 - 62 or, remove those internal comments or, instead of using the official comment syntax of /* .... */, you can use the line comment of // in front of what you want to comment out. At least that worked when I used it in the inspector.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Hello, Rod,
perfect - many thanks for finding the error. Now I like that again
On to the next point...
Best regards
https://www.mc-photografie.de - Backlight 3
https://bl3.mc-photografie.de - Backlight 3 Testsite
http://backup.der-canonier.de - Backlight 2
Offline
Hi,
how can I make the "Scroll-to-top-button" appear on a large monitor in the .page__pallet__bottom or correspond with it?
So this is about the place.
So the position should be fixed, but related to the .page__pallet__bottom - area.
If I change "right" in custom.css, the position moves logically when the monitor widths change.
Many greetings
Markus
https://www.mc-photografie.de - Backlight 3
https://bl3.mc-photografie.de - Backlight 3 Testsite
http://backup.der-canonier.de - Backlight 2
Offline
You don’t want it popping up as the user scrolls down the page, but only appear in the footer area?
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Pages: 1