Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-05-2012, 01:37 AM   PM User | #1
Shintex
New to the CF scene

 
Join Date: Oct 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Shintex is an unknown quantity at this point
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 02:07 PM..
Shintex is offline   Reply With Quote
Old 10-05-2012, 07:33 AM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
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.
Philip M is offline   Reply With Quote
Old 10-05-2012, 02:08 PM   PM User | #3
Shintex
New to the CF scene

 
Join Date: Oct 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Shintex is an unknown quantity at this point
Okay I've edited my first post. The code is there now.
Shintex is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 04:29 AM.


Advertisement
Log in to turn off these ads.