Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation URGENT help needed with a slideshow - Easy question

    Okay so here's the page.
    http://94.168.220.152:82/

    As you can see, there are two slideshow controls. When I click both of them, the same image appears. When I click on them, I want it to be different images, like an actual slideshow.

    The javascript as of now:
    Code:
    $(document).ready(function(){
    	$('img#bg').attr( 'src', 'background.png' ).show();
    	$('#slideshow-caption').text( $('#slideshow-buttons img:first').attr( 'title' ) );
    	$('#slideshow-buttons img:first').attr( 'src', 'imgs/slideshow_page_selected.png' );
    	var selected = $('#slideshow-buttons img');
    	
    	$('#slideshow-buttons img').each(function(){
    		$(this).click(function(event){
    			if( selected == this )
    				return false;
    				
    			var m_this = this;
    			$('img#bg').fadeOut( 'slow', function(){
    				$('#slideshow-caption').text( $(m_this).attr( 'title' ) );
    				$(selected).attr( 'src', 'imgs/slideshow_page.png' );
    				$(m_this).attr( 'src', 'imgs/slideshow_page_selected.png' );
    				selected = m_this;
    				
    				$('img#bg').fadeIn('slow');
    			});
    		});
    	});
    });
    Thanks much. Need some urgent help on this.
    Last edited by Shintex; 10-05-2012 at 03:07 PM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,318
    Thanks
    203
    Thanked 2,566 Times in 2,544 Posts
    Prefer to show your relevant code. People are reluctant to open links offered by newcomers. Especially of the form http://94.168.220.152:82

    It is your responsibility to die() if necessary….. - PHP Manual

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay I've edited my first post. The code is there now.


  •  

    Posting Permissions

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