*

BabyDunk

  • ****
  • 161 posts
share-friendly scroll to bottom
« on: June 10, 2016, 05:00:30 AM »
hey Frosticek

was wondering if you could point me in the right direction. i want to make share-friendly clickable and when doing so the page would scroll to bottom to show off the social share links. 

this is what i have tried but must be missing something

Code: [Select]
<script>

    $(document).ready(function () {

    $('#sharebottom').click(function () { $('html, body').animate({ scrollTop: $(document).height() }, 1000); }); });
</script>

<a href="#sharebottom">
      <div class="share-friendly noselect">
        <div class="text"><?php _e('Share us and become our fan''patricia'); ?></div>
        <img src="<?php echo osc_current_web_theme_url();?>images/side_share.png" />
      </div>
    </div>
</a>

im not sure if their is something i have failing to call or if the way im calling just is incorrect.

but anyway it would be a nice add for patricia

all the best and as always many thanks
Chris
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

MB Themes

Re: share-friendly scroll to bottom
« Reply #1 on: June 10, 2016, 08:15:53 AM »
@aweegander
Change:
Code: [Select]
<a href="#sharebottom">
into:
Code: [Select]
<a href="#" id="#sharebottom">
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BabyDunk

  • ****
  • 161 posts
Re: share-friendly scroll to bottom
« Reply #2 on: June 11, 2016, 12:24:29 AM »
Thanks for the point in the right direction, you were just slightly out.

it needed to be
Code: [Select]
<a href="#sharebottom" id="sharebottom">
but many thanks . your a Champ  ;)


if anyone else would like scroll to bottom for the share button have down the sidebar. on the main.php

replace this
Code: [Select]
       
<div class="share-friendly noselect">
          <div class="text"><?php _e('Share us and become our fan, Click Here''patricia'); ?></div>
          <img src="<?php echo osc_current_web_theme_url();?>images/side_share.png" />
        </div>
        </div>

with this
Code: [Select]
<script async="async">
    $(document).ready(function () {
    $('#sharebottom').click(function () { $('html, body').animate({ scrollTop: $(document).height() }, 1000); }); });
</script>
<a href="#sharebottom" id="sharebottom">
      <div class="share-friendly noselect">
        <div class="text"><?php _e('Share us and become our fan, Click Here''patricia'); ?></div>
        <img src="<?php echo osc_current_web_theme_url();?>images/side_share.png" />
      </div>
    </div>
</a>

and if you want it on the item.php their is a slight change . their will be one to many </div> at the end . so one needs to be removed like this
Code: [Select]
<script async="async">

    $(document).ready(function () {

    $('#sharebottom').click(function () { $('html, body').animate({ scrollTop: $(document).height() }, 1000); }); });
</script>
<a href="#sharebottom" id="sharebottom">
      <div class="share-friendly noselect">
        <div class="text"><?php _e('Share us and become our fan, Click Here''patricia'); ?></div>
        <img src="<?php echo osc_current_web_theme_url();?>images/side_share.png" />
      </div>
</a>

it works a treat 

Cheers Frosticek
Chris
« Last Edit: June 11, 2016, 04:04:21 PM by aweegander »
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

MB Themes

Re: share-friendly scroll to bottom
« Reply #3 on: June 11, 2016, 08:11:37 PM »
@aweegander
href="#sharebottom" has no real sense there, as moving is granted by javascript.
It means without use of javascript to move into element with ID sharebottom, but that ID is set on this button.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BabyDunk

  • ****
  • 161 posts
Re: share-friendly scroll to bottom
« Reply #4 on: June 11, 2016, 09:58:01 PM »
i tried as you said
Code: [Select]
<a href="#" id="sharebottom">  but it would not do anything apart add /# to the end of the domain.

it wasnt until i used
Code: [Select]
<a href="#sharebottom" id="sharebottom">  that the page would actually scroll to bottom.

you know i dont actually know how it works but it does, although it does seem abit violent https://www.aweegander.com
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

MB Themes

Re: share-friendly scroll to bottom
« Reply #5 on: June 12, 2016, 02:44:22 PM »
@aweegander
I think you did not secured default behaviour. Does it work same if you place i.e. #abc into href?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BabyDunk

  • ****
  • 161 posts
Re: share-friendly scroll to bottom
« Reply #6 on: June 13, 2016, 11:27:20 AM »
scrolls to bottom
Code: [Select]
<a href="#abc" id="sharebottom">
and now your original suggestion scrolls to the bottom also
Code: [Select]
<a href="#" id="sharebottom">
their must have been one of my cache i forgot to reset when testing. probs the one in the browser ::)
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D