PHP Classes

How to Implement a PHP Scroll to Top Link in a Site with Content Managed by the ASCOOS CMS Using the Package Scroll to Top: Show a button to scroll the page to the top

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-10-20 (Yesterday) RSS 2.0 feedNot yet rated by the usersTotal: 35 This week: 6All time: 11,009 This week: 6Up
Version License PHP version Categories
scroll_to_top 1.0.1Custom (specified...5.6HTML, PHP 5, Content management, PHP 8
Description 

Author

This package can show a button to scroll the page to the top.

It provides scripts to work on a site that uses the ASCOOS CMS to generate content web pages.

The scripts insert links at the bottom of the pages that users can click to scroll the browser view to the top.

Picture of ASCOOS CMS
  Performance   Level  
Name: ASCOOS CMS <contact>
Classes: 16 packages by
Country: Greece Greece
Innovation award
Innovation award
Nominee: 11x

Instructions

You can see a tutorial here.

This block uses the JQuery Ascoos Library (JAscoos) built into Ascoos Cms. You can find here.

Example

<?php
/**
 * __ _ ___ ___ ___ ___ ___ ____ _ __ ___ ___
 * / _` |/ / / __/ _ \ / _ \ / / / __/| '_ ` _ \ / /
 * | (_| |\ \| (_| (_) | (_) |\ \ | (__ | | | | | |\ \
 * \__,_|/__/ \___\___/ \___/ /__/ \___\|_| |_| |_|/__/
 *
 *
 ************************************************************************************
 * @ASCOOS-NAME : ASCOOS CMS 24' *
 * @ASCOOS-VERSION : 24.0.0 *
 * @ASCOOS-CATEGORY : Block (Frontend and Administrator Side) *
 * @ASCOOS-CREATOR : Drogidis Christos *
 * @ASCOOS-SITE : www.ascoos.com *
 * @ASCOOS-LICENSE : [Commercial] http://docs.ascoos.com/lics/ascoos/AGL.html *
 * @ASCOOS-COPYRIGHT : Copyright (c) 2007 - 2024, AlexSoft Software. *
 ************************************************************************************
 *
 * @package : Scroll to Top Button
 * @subpackage : Main Frontend File
 * @source : /[BLOCKS PATH]/scroll_to_top/index.php
 * @fileNo :
 * @version : 1.0.1
 * @created : 2012-01-02 17:50:00 UTC+3
 * @updated : 2024-10-03 05:00:00 UTC+3
 * @author : Drogidis Christos
 * @authorSite : www.alexsoft.gr
 * @license : AGL-F
 *
 * @since PHP 8.2.0
 */

defined ("ALEXSOFT_RUN_CMS") or die("Prohibition of Access.");

global
$app;


$topElem = $block->getParam('int', 'topElem', 100 ); // The position from the top where the scroll object will appear.
$animateSpeed = $block->getParam('int', 'animateSpeed', 800 ); // The scrolling speed
$finalScrollTop = $block->getParam('int', 'finalScrollTop', 0 ); // The final height from the top after scrolling
$theme = $block->getParam('lstr', 'theme', 'default' );

$block->loadTheme($theme);

$script="jQuery(window).scrollToTop('#scrollToTop', {topElem:".$topElem.", animateSpeed:".$animateSpeed.", finalScrollTop:".$finalScrollTop."});";
$app->head->addJAScript($script);
echo
"<a href=\"#\" id=\"scrollToTop\">".$block->getLangVar('scrolltop')."</a>";
?>


Details

[1.0.1] - 2024-10-03

FOR PHP >= 8.2.0

  • Added file Ascoos Cms License (`LICENSE_AGL-F.md`)
  • Updated file `install.php`
  • Updated file `index.php`
  • Updated file `.htaccess`
  • Updated file `params.json`
  • Updated language files

*

[1.0.0] - 2012-01-02

  • Initial release

Screenshots (1)  
  • screenshot.png
  Files folder image Files (31)  
File Role Description
Files folder imagehelp (16 files)
Files folder imagelanguages (7 files)
Accessible without login Plain text file .htaccess Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file install.php Example Example script
Accessible without login Plain text file LICENSE_AGL-F.md Lic. License text
Accessible without login Plain text file params.json Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (31)  /  help  
File Role Description
  Accessible without login HTML file index.html Doc. Documentation
  Accessible without login Image file scr-ascoos-explorer-000.png Icon Icon image
  Accessible without login Image file scr-block-001-800px.png Icon Icon image
  Accessible without login Image file scr-block-002-800px.png Icon Icon image
  Accessible without login Image file scr-block-003-800px.png Icon Icon image
  Accessible without login Image file scr-block-004-800px.png Icon Icon image
  Accessible without login Image file scr-block-005.png Icon Icon image
  Accessible without login Image file scr-block-006.png Icon Icon image
  Accessible without login Image file scr-block-007.png Icon Icon image
  Accessible without login Image file scr-block-008.png Icon Icon image
  Accessible without login Image file scr-installer-000.png Icon Icon image
  Accessible without login Image file scr-installer-001-1280.png Icon Icon image
  Accessible without login Image file scr-installer-002-1280.png Icon Icon image
  Accessible without login Image file scr-installer-003-1280.png Icon Icon image
  Accessible without login Plain text file tutorial.el.md Data Auxiliary data
  Accessible without login Plain text file tutorial.en.md Data Auxiliary data

  Files folder image Files (31)  /  languages  
File Role Description
  Plain text file el-CY.php Class Class source
  Plain text file el-GR.php Class Class source
  Plain text file el.php Class Class source
  Plain text file en-GB.php Class Class source
  Plain text file en-US.php Class Class source
  Plain text file en.php Class Class source
  Accessible without login HTML file index.html Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
Downloadscroll_to_top-2024-10-20.zip 1623KB
Downloadscroll_to_top-2024-10-20.tar.gz
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
PHP Backwards Compatibility Library Download .zip .tar.gz Included in ASCOOS CMS Recommended
 Version Control Unique User Downloads Download Rankings  
 100%
Total:35
This week:6
All time:11,009
This week:6Up