jQuery Cycle Plugin - Link.
- Started
- Last post
- 7 Responses
- pillhead
Good Day All.
Quick question.
Is it possible to link from a jQuery slide image on my index page, to a different slide on say my design page, and have that link go to a specific slide on my design page. Example, if I link from slide 5 on my index page, it would then link up to slide 5 on my design page.
- acescence0
link to a page with a hash, read that hash on page load and jump to that slide via the instructions on the demo "specifying a starting slide"
- pillhead0
Does anyone here have any slide examples I could look at to get my head around the code.
I'm trying to link from slide 5 on my index page, that will then link up to slide 5 on my design page.
- acescence0
this would be the target page, let's call it slides.html. you would link to this page with slides.html#3 which would start with slide 4 (slides are zero based!).
http://gist.github.com/628329- Thanks for that acescence, I will have a look at the code.pillhead
- gregorywieber0
I think you're talking about 'deep linking' (what flash people usually use swfaddress for). This plugin for jQuery is really good for that sort of thing: http://benalman.com/projects/jqu…
You can combine that with something like scrollTo. With those two things, you can use old fashioned anchor tags in your pages and scroll right to those areas of the page.
- pillhead0
acescence kindly write this code for me to get my slide to link up to other slide on a different page which works great, trouble is I need to change the FX setting and when they are changed the links slide stop working. Can someone help me get this working please.
FX setting I Need to Use
fx: 'scrollHorz',
speed: 'fast',
timeout: 0,
--------------------------------...
acescence code:<script type="text/javascript">
$(window).ready(function(){
var start;
if(window.location.hash){
start = window.location.hash.substr(1);
} else {
start = 0;
}
$('#slides').cycle({
fx: 'fade',
startingSlide: start,
timeout: 3000,
delay: -2000
});
});
</script>Test Page Here: http://waynegrant.pwp.blueyonder…
- acescence0
you left out the startingSlide parameter in slides.html
$('#slides').cycle({
startingSlide: start,
fx: 'scrollHorz',
speed: 'fast',
timeout: 0,
pager: '#nav',
pagerAnchorBuilder: function(idx, slide) {
// return sel string for existing anchor
return '#nav li:eq(' + (idx) + ') a';
}
});- Holy shit, it lives. Thanks again acescence you a life saver.pillhead