Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Member sstjohn's Avatar
    Join Date
    Feb 2012
    Location
    Indiana
    Posts
    33
    Member #
    30934
    Liked
    5 times
    I am using the jquery library for my site (download here) and bump box (download here). I want to use the bump box for a few items on the site as well as utilize a smooth scrolling when an image is clicked on the page (it takes you to the bottom of the page by smoothly auto scrolling the entire page. There is also a button at the bottom to do the opposite). If I link my index.html to one of the .js files via <script>, the other is killed. Here is the scroll code linked by scroll.js (there is a tutorial for this here and the demo here):

    Code:
    $(document).ready(function(){
    $(".scroll").click(function(event){
    //prevent the default action for the click event
    event.preventDefault();
    
    //get the full url - like mysitecom/index.htm#home
    var full_url = this.href;
    
    //split the url by # and get the anchor target name - home in mysitecom/index.htm#home
    var parts = full_url.split("#");
    var trgt = parts[1];
    
    //get the top offset of the target anchor
    var target_offset = $("#"+trgt).offset();
    var target_top = target_offset.top;
    
    //goto that anchor by setting the body scroll top to anchor top
    $('html, body').animate({scrollTop:target_top}, 1200);
    });
    });
    Not great with javascript or jquery. Any help would be awesome!

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

bump box in jquery

,

bumpbox jquery

,

jquery bumpbox download

,

js bump box installation

Click on a term to search for related topics.
All times are GMT -6. The time now is 07:03 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com