JQuery scrollTo issue... Grrr.
- Started
- Last post
- 17 Responses
- sisu
If you could help out, i'd truly appreciate it.
I am working on a site, designing and developing at the same time using JQuery - cycle, localScrool, and scrollTo.
I have 2 links posted, one that works in FF, Safari, and IE: www.sisuhome.com/new/cycle/
And another that doesn't work in Safari (and probably not IE): http://sisuhome.com/new/cycle2/
Why is it that when I add more links (more than 10?) to my nav (and js) the scrolling doesn't work in Safari?
Any help would be suuuuuper appreciated.
- sisu0
When you click on the nav items in the second link, does it scroll? Or jump?
- sisu0
I'm so tired... going to bed now. Any insight would be appreciated.
- Stugoo0
Safari firefox and chrome all fine here mate.
- stewdio0
I don't know if this helps, but you might be able to simplify quite a bit; use less overhead, less code to debug. For example, you may not need even jQuery to do the scrolling. Here's an example of scrolling around a page on both the X and Y axis at the same time. Select something in the drop-down menu and watch the page glide :
http://rebecky.com/have---------…Now check out the HTML source for that, but also notice how small the external JavaScript file is :
http://rebecky.com/have---------…This code is from summer 2006 so I imagine I'd do it differently now, but I'm still happy with how light weight it is.
- 3030
you have scroll added twice:
<script src="js/jquery.scrollTo-1.4.2/jquery.scrollTo-min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.localScroll-1.2.7/jquery.localscroll-min.js" type="text/javascript" charset="utf-8"></script>And try to add return false; to the function that handles the clicking - it will prevent from executing the url for anchors #slideshow3...
- It's not included twice. That's how you use localScroll
http://demos.flesler…welded - Also, you want the links to update the URL fragment so 'pages' can be bookmarked or linked to.welded
- It's not included twice. That's how you use localScroll
- 3030
I am using jQuery scrollTo and this how I handle the clicking and scrolling:
$("#mainNav li.scrollTo a").click(function(){
var $an = jQuery(this).attr("href");$.scrollTo($an, {duration: 800, axis:"y", onAfter:function() {
location.hash = $an;
}
});return false;
});
- welded0
Both pages work for me in Safari, too. Are you sure you're properly clearing your cache?
- bulletfactory0
works here.
- 3030
@welded - look at my second post - once link is clicked, URL in the browser gets an update so you are able to bookmark it;
- welded0
Ah, I see. Without 'document.' preceding it I assumed location.hash was some variable your script needed elsewhere.
- sisu0
Thanks guys. Back on this now and just noticed something very odd... the linked examples I posted work fine in FF and Safari but it DOESN'T work locally in Safari - wtf?!?!?
Can anyone tell me why?
The URL should updating with a hash when clicked to enable bookmarking the 'pages' - it is for me at least.
- sisu0
Once again, here is the link to reference:
http://sisuhome.com/new/cycle2/
- welded0
I've seen what you're describing before, especially with swfAddress and Flash sites, but if it's only happening locally then don't sweat it.
- sisu0
Excited! Just figured this out,
The reason the vertical page scrolling doesn't work locally is because of a Safari bug (i'm using 4.0.5). Safari didn't like the name of my local site folder because its name had a space in it - "New Site". As soon as I took the space out - "NewSite" - the scrolling worked locally.
And I thought we were past the days of no caps, no spaces.
- caps are fine, spaces and other special characters need to be escaped, ie %20 instead of spaceacescence
- http://www.blooberry…acescence
- Right, I guess I I never thought it mattered for the site folder name... never run into this before.sisu
- Thanks for posting your problem/fix... I just had the same thing happen to me. Drove me nuts for about 4 hours!crhayes
- SPECTACULAR0
our yew related 2 http://sisumedia.com/ ?
- Whoa, that company sure has changed (for the better). No relation.sisu
- sisu0
I guess it's more likely to be an issue with the JQuery than with Safari.