SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Link to specific slider item using href

    Hi there,

    I was wondering it would be possible, either with the iosslider (preferably, or any other JQuery slider) and slide to a specific slider item using an href link. The href link would be on the same page so no trickery would be needed to pass functions across multiple pages or anything...surely this is a simple addition?

    My plan is to make a href which jumps down the page to the slider location and then automatically slide to a particular slider item. I know some form of timeout would need to be in place to delay the "jump down" navigation but I just wondered if linking to specific slider items is even possible.

    Any thoughts?

    Cheers,

    Shoxt3r.

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all!

    Okay, I've managed to get it working using one of the examples iOSScripts provided - the Image Gallery example.
    I've switched out the buttons for hrefs and got it to switch from one item to another. Now I just need to make it so that it delays after the user clicks....any thoughts?

    Below is the current script.

    Code:
    $(document).ready(function() {
    			
    				$('.iosSlider').iosSlider({
    					scrollbar: true,
    					snapToChildren: true,
    					desktopClickDrag: true,
    					navSlideSelector: $('.button'),
    					scrollbarHeight: '2',
    					scrollbarBorderRadius: '0',
    					scrollbarOpacity: '0.5',
    					onSlideChange: slideContentChange, 
    					onSliderLoaded: slideContentChange
    				});
    				
    				function slideContentChange(args) {
    					 
    					/* indicator */
    					$('.button').removeClass('selected');
    					$('.button:eq(' + args.currentSlideNumber + ')').addClass('selected');
    					
    				}
    				
    			});

  3. #3
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    You could put a setTimeout on the slideContentChange() func, though usually these jQuery plugins are so large because they include every possible option someone would want and then a pony. Meaning it wouldn't surprise me if there was a Delay option somewhere.


Bookmarks

Posting Permissions

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