Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Auto scroll and stop.
Old 12-10-2005, 11:30 AM Auto scroll and stop.
Ultra Talker

Posts: 330
Trades: 0
I need to find a JavaScript code that will make the page scroll down to a spot, and then stop. I've tried an auto scroll script but it scrolls all the way to the bottom. I cant use anchor tags because its not an option for what I'm working with. Please reply if you can help me out or if you know the code I can use.

-Joe
JGiannotti is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-10-2005, 02:59 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
window.scroll(x,y) or window.scrollTo(x,y)

Then there is window.scrollBy(x,y) , window.scrollByLines(number_of_lines) or window.scrollByPages(number_of_pages)

Take your pick
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-10-2005, 11:13 PM ok
Ultra Talker

Posts: 330
Trades: 0
ok and if their text size in IE was set to "largest" it would mess up the positioning, so is there a way to use JS to make their text size medium for that page?
JGiannotti is offline
Reply With Quote
View Public Profile
 
Old 12-11-2005, 05:11 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
if visitors have their text set to largest there is probably a reason. ie they cannot read smaller text. so why do you want to alienate these visitors simply because it "messes up" your design.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-11-2005, 05:48 AM no...
Ultra Talker

Posts: 330
Trades: 0
if their text size is set differently, and I want the window to scroll exactly 600 pixels down, then it will be different on separate computers
JGiannotti is offline
Reply With Quote
View Public Profile
 
Old 12-11-2005, 06:00 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
ask yourself a few basic questions.

1/ are people using larger text sizes likely to visit the site.
2/ is it going to interest them should they get there.
3/ does it really matter for those (very) few users if it doesn't scroll exactly

last and most importantly are those same few users likely to be browsing on a (also) javascript disabled browser in which case it won't be scrolling anyway.

Don't get carried away with your own sense of self importance of your website, it's probably only ever going to be seen by a relatively small proportion of internet users anyway and out of those, there will be more with javascript off than are using different text sizes.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-11-2005, 02:49 PM Really?
Ultra Talker

Posts: 330
Trades: 0
Quote:
Originally Posted by chrishirst
Don't get carried away with your own sense of self importance of your website, it's probably only ever going to be seen by a relatively small proportion of internet users anyway
I've had my website up for less than a week:



And its yet to become more popular. I'm sure your self importance level is fairly high seeing that you waste life lurking around a forum, making 1,252 posts that ultimately lead to... nothing?
JGiannotti is offline
Reply With Quote
View Public Profile
 
Old 12-11-2005, 03:41 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And that's just this forum. Obviously I've been in the wrong business for the past 6 years or so, but that's life.

Really! see what I mean about over blown self importance There are approx 1 billion Internet users (according to the last stats I saw). your stats appear to be reaching a extremely minute percentage of that, as does just about every other website on the internet there aren't many CNNs around.
I have a sense of perspective about how insignificant the sites I run are in the grand scheme of things but then I am not trying to find a way to force users who have their browsers set to suit them, reset it to my view of how they should be using the internet.

Enjoy
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-11-2005, 10:05 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
The user is king. They will make or break your site... your site designs must bend to them and how they use their computer.

You could try to get the position of the element you wish to scroll to, then calculate the scrollTo.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 12-11-2005, 10:09 PM
Ultra Talker

Posts: 330
Trades: 0
Its not my site that I want the font consistant, its a page that will be an iframe, and I need to scroll to a button on the page and thats all I want to be displayed is the button on the page inside of the iframe. so the iframe will have precise width and height. Thats why I need everything to be consistant.
JGiannotti is offline
Reply With Quote
View Public Profile
 
Old 12-11-2005, 10:12 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
If the page in the iFrame is not in your site, you're going to have a hard time doing anything with it as most (good) browsers restrict JS access to the page for security reasons. (ie phishing) As Isaid before you can try and get the position of the button, and then calculate the correct amount to scroll, but I don't know if that will work with a page from another site.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Reply     « Reply to Auto scroll and stop.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31680 seconds with 12 queries