By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,312 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

jQuery problem in IE

P: 59
http://wexcode.com/portfolio.php

For some reason, this page doesn't work in IE, but seems to work fine in all other browsers. Can anyone identify why this isn't working in IE? Thanks.

Expand|Select|Wrap|Line Numbers
  1. $(function() {
  2.     $( "#small" ).accessNews();    
  3.     $(".javascript_css").css("display", "none");
  4.  
  5.     // http://blueonionsoftware.com/blog.aspx?p=4f47563f-69c4-4483-9a98-8c6a425fcf2c
  6.     $.fn.delay = function(time, callback)
  7.     {
  8.         return this.animate({ opacity: '+=0' }, time, callback);
  9.     }    
  10.  
  11.     /* Switch to large and back */
  12.     $.fn.swapImage = function(){
  13.         var name = $(this).attr("src");
  14.         name = name.substr(0, name.length - 10);
  15.         var image = "img[src='" + name + "_big.gif']";
  16.         var width = $(image).width();
  17.         var height = $(image).height();
  18.         $("#small").css("display", "none");
  19.         $(image).parent().parent().css("visibility", "visible");
  20.         $("#big").animate({height: height, width: width, padding: "12px 7px 12px 12px"}, 0);
  21.         $("#content").animate({width: width});
  22.         newWidth = width + 100 + "px";
  23.         $("#container").animate({width: newWidth}, 0);
  24.         return image;
  25.     };
  26.  
  27.     $("#small li a img").click(function() {
  28.         var image = $(this).swapImage();
  29.         $(image).click(function() {
  30.             // Finish the animation first...
  31.             if(!$("#small").is(":animated")) {
  32.                 $("#container").animate({width: "712px"}, 0);
  33.                 $("#content").width("635px");
  34.                 $("#big").animate({height: "1px", width: "1px", padding: "0px"}, 0);
  35.                 $("#small").delay(0).fadeIn(0);
  36.             }
  37.             return false;
  38.         });
  39.         return false;
  40.     });
  41.  
  42.     /* Switch to thumbnails and back */
  43.     $.fn.switchThumbs = function(){
  44.         $("#small").delay(0).toggle("slow");
  45.         $("#thumbnails").delay(0).toggle("slow");
  46.     };
  47.     $(".view-all a, .view-less a").click(function() {
  48.         // Make sure that a double click doesn't have any effect
  49.         if(!$("#small, #thumbnails").is(":animated"))
  50.             $(this).switchThumbs();
  51.     });
  52.  
  53. });
Jan 3 '10 #1
Share this Question
Share on Google+
3 Replies


gits
Expert Mod 5K+
P: 5,390
what exactly is not working and is it with a specific IE version or IE in general?

kind regards
Jan 4 '10 #2

P: 59
Nevermind, I figured it out. Seems that jQuery doesn't like:

$("#big").animate({height: height, width: width, padding: "12px 7px 12px 12px"}, 0);

Apparently, it works better with:
style: 'padding: 12px 7px 12px 12px'
Jan 5 '10 #3

gits
Expert Mod 5K+
P: 5,390
glad to hear that you got it working ... :) ... and thanks for posting the solution ...

kind regards
Jan 5 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.