Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,256
Total Threads: 81,169
Total Posts: 566,839
There are 62 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

swapping images..

Thread title: swapping images..
Reply    
    Thread tools Search this thread Display Modes  
03-27-2011, 02:19 AM
#1
Psychotomus is offline Psychotomus
Status: Member
Join date: Mar 2005
Location: baltimore, md, usa
Expertise: php, mySQL, js, aJax
Software: virtual brain cells
 
Posts: 167
iTrader: 0 / 0%
 

Psychotomus is on a distinguished road

  Old  swapping images..

Heres a snipplet from my JS file..

Code:
	$("#next").mouseup(function () {
		$.ajax({
		      url: "ajax/userSlider.php?userID=" + lastUserID,
		      global: false,
		      type: "GET",
		      dataType: "html",
		      success: function(msg){    
			  	userSplit = new Array();
			  	userSplit = msg.split(":");
				
				if(userSplit[0] == "Ok")
				{
					$("#img_1a").attr("src", $("#img_2b").attr("src"));
					$("#img_1b").attr("href",$("#img_2a").attr("href"));
					alert($("#img_2b").attr("src"));
					$("#img_2a").attr("src", $("#img_3b").attr("src"));
					$("#img_2b").attr("href",$("#img_3a").attr("href"));

					$("#img_3a").attr("src", $("#img_4b").attr("src"));
					$("#img_3b").attr("href",$("#img_4a").attr("href"));
					
					
				}
Now I hardcoded my userSplider.php for now so userSplit[0] always returns Ok.
alert($("#img_2b").attr("src")); always returns the src value of img_2b so thats not the problem.

The problem is it doesn't switch all the images. I also get no errors from my FireFox Error Console.

Page www.psprpg.info

04-03-2011, 08:28 PM
#2
Psychotomus is offline Psychotomus
Status: Member
Join date: Mar 2005
Location: baltimore, md, usa
Expertise: php, mySQL, js, aJax
Software: virtual brain cells
 
Posts: 167
iTrader: 0 / 0%
 

Psychotomus is on a distinguished road

  Old

Anybody? ;]

Reply With Quote
Reply    


Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed