Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    884
    Thanks
    53
    Thanked 6 Times in 5 Posts

    scroll to top of page variation

    This code scrolls the user to the position of the first field that errors in a form upon validation (part of jquery.bvalidator.js):

    Code:
    if(options.scrollToError){
       // get most top tolltip
       var tot = tooltip.offset().top;
       if(scroll_to === null || tot < scroll_to)
       scroll_to = tot;
    }
    Because my html right-content scrolls up under an "always in view" header, the scroll up to the tooltip actually doesn't scroll up far enough, by about 100px.

    Is there a way to modify the code above to go up 100px more?
    The difference between genius and stupidity is that genius has its limits. (Albert Einstein)

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Posts
    165
    Thanks
    1
    Thanked 39 Times in 39 Posts
    I'm assuming this is related to the same project we've been discussing? You hadn't mentioned this scrolling issue, but I'll look into it while working on the other stuff. Emailed you a potential solution earlier today regarding the validation issues, but it was just a Q&D (quick and dirty) suggestion off the top of my head, so may not work at all or may just need tweaking. All details are in the email, but I'll add this scrolling issue to my to-do list for you

  • #3
    Regular Coder
    Join Date
    Apr 2012
    Posts
    165
    Thanks
    1
    Thanked 39 Times in 39 Posts
    Just sent you a zip with all the files needed for the new and improved version of the form (and I was able to fix the scrolling issue for you as well). Enjoy!


  •  

    Posting Permissions

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