Author Topic: swapping images...  (Read 538 times)

Offline Sim

  • Level 13
  • *
  • Posts: 104
  • Reputation: +1/-1
    • View Profile
    • Online RPG Creator
swapping images...
« on: March 26, 2011, 12:19:18 AM »
Heres a snipplet from my JS file..

Code: [Select]
$("#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

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal