Advertisement:

Author Topic: SCROLL TOP + SCROLL DOWN - WITHOUT ANY PLUGIN  (Read 1370 times)

aks

  • Full Member
  • ***
  • Posts: 179
SCROLL TOP + SCROLL DOWN - WITHOUT ANY PLUGIN
« on: October 15, 2013, 02:17:13 pm »
I HAVE DEVELOPED A SMALL CODE -
CREATE COMMON/IMAGES FOLDER ON ROOT, ADD IMAGES THERE
AND PASTE CODE IN FOOTER.PHP OF THEME:
---------
<!--move up down -->
<script type="text/javascript">
    $(document).ready(function(){
        $('#gotop').click(function(){
            $('html, body').animate({ scrollTop: 0 }, 'slow');
        });
    });
</script>
<div style="z-index:10;top:50%;right:2px;position: fixed;">
<img id="gotop" style="cursor:pointer" border="0" src="<?php echo osc_base_url();?>common/images/upred.png" title="Move upward" width="28" height="28"><br/>
<img style="cursor:pointer" onclick="window.scrollBy(0,30);" border="0" src="<?php echo osc_base_url();?>common/images/downred.png" title="Move slightly downward" width="28" height="28"></div>
« Last Edit: October 15, 2013, 02:19:41 pm by aks »

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: SCROLL TOP + SCROLL DOWN - WITHOUT ANY PLUGIN
« Reply #1 on: October 15, 2013, 03:32:53 pm »
Thanks aks! It works perfectly!

dev101

aks

  • Full Member
  • ***
  • Posts: 179
Re: SCROLL TOP + SCROLL DOWN - WITHOUT ANY PLUGIN
« Reply #2 on: October 15, 2013, 03:43:21 pm »
THANKS..AM NOT AWARE HOW TO CREATE A PLUGIN.. I WOULD HAVE CREATED...

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: SCROLL TOP + SCROLL DOWN - WITHOUT ANY PLUGIN
« Reply #3 on: October 15, 2013, 03:56:24 pm »
I think it is a complete overkill to embed a theme-related feature as a plugin (and yes, there is one in the forums, but pretty old).

dev101