开发者

Make bind() function to live bind function

开发者 https://www.devze.com 2023-03-25 05:29 出处:网络
I have some problems to find the correct synthax. This is my old code: jQuery(\"#file1\").live(\'change\', function(){

I have some problems to find the correct synthax. This is my old code:

jQuery("#file1").live('change', function(){
开发者_高级运维     jQuery('.pic_upload').fadeIn();    
});

I had to change it because of IE issues. This is my new one:

jQuery("#file1").bind((jQuery.browser.msie && jQuery.browser.version < 9) ? 'propertychange' :  'change',
   function(){ jQuery('.pic_upload').show();
  });

Ho can I implement the 'live' to my new function?


If I understand your question correctly, you just want to change fadeIn() to show() and bind to 'propertychange' in versions of IE before 9. In that case, this should work:

jQuery("#file1").live((jQuery.browser.msie && jQuery.browser.version < 9) ? 'propertychange' :  'change', function(){
     jQuery('.pic_upload').show();   
});
0

精彩评论

暂无评论...
验证码 换一张
取 消