Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-09-2012, 04:31 AM   PM User | #1
tpeck
Regular Coder

 
tpeck's Avatar
 
Join Date: Oct 2002
Location: Sydney, Australia
Posts: 778
Thanks: 41
Thanked 5 Times in 4 Posts
tpeck is on a distinguished road
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)
tpeck is offline   Reply With Quote
Old 06-10-2012, 07:59 AM   PM User | #2
EpicWebDesign
Regular Coder

 
Join Date: Apr 2012
Posts: 165
Thanks: 1
Thanked 39 Times in 39 Posts
EpicWebDesign will become famous soon enough
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
EpicWebDesign is offline   Reply With Quote
Old 06-11-2012, 11:54 PM   PM User | #3
EpicWebDesign
Regular Coder

 
Join Date: Apr 2012
Posts: 165
Thanks: 1
Thanked 39 Times in 39 Posts
EpicWebDesign will become famous soon enough
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!
EpicWebDesign is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:33 AM.


Advertisement
Log in to turn off these ads.