Make bind() function to live bind 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();
});
精彩评论