[jQuery] Re: script killing IE
The blur actually does work. All I needed the blur to do was not show that box around the clicked link. I have now completely reconfigured this script. I think I was making it too difficult. This now works in IE: $(function(){ bindResults = function(){ $('#sbmsdata_1 a').click(function(){ $('#sbmsdata_1 img').attr('src','/images/sbms/folderclosed.gif'); $('img', $(this).parent().prev()).attr('src','/images/sbms/folderopen.gif'); var linkval = $(this).attr('href'); $(this).blur(); $('#sbmsitems').load(linkval, function(){ $('a', this).click(function(){ $(this).blur(); return false; }); }); return false; }); } var openfolder = 'none'; loadSubjects = function(scope){ $('a', scope).click(function(){ $('table#sbmsdata_1').remove(); $('#sbmsitems').empty(); if($(this).is('.sbmsopen')){ $(this).removeClass('sbmsopen'); $('img','#sbmsdata_0').attr('src','/images/sbms/folderclosed.gif'); } else{ $('img','#sbmsdata_0').attr('src','/images/sbms/folderclosed.gif'); $('a','#sbmsdata_0').removeClass('sbmsopen'); var linkval = $(this).attr('href'); $.post(linkval, function(j){ $(placement).append(j); bindResults(); }); $(this).addClass('sbmsopen'); var placement = $(this).parent(); $('img', $(this).parent().prev()).attr('src','/images/sbms/folderopen.gif'); } $(this).blur(); return false; }); } loadSubjects('#sbmssubjects'); }); On 6/4/07 12:43 PM, "Benjamin Sterling" <[EMAIL PROTECTED]> wrote: > Shelane, > First, you should be able to chain a few of your functions, ie: > $(this).unbind().click(function()... > > Secondly, I may be misunderstanding the purpose of the .blur function but I > don't think it will work the exact way you are using it: > > "Note: This does not execute the blur method of the underlying elements! If > you need to blur an element via code, you have to use the DOM method, eg. > $("#myinput")[0].blur();" > > Sorry if I am not much help.
[jQuery] Re: script killing IE
Shelane, First, you should be able to chain a few of your functions, ie: $(this).unbind().click(function()... Secondly, I may be misunderstanding the purpose of the .blur function but I don't think it will work the exact way you are using it: "Note: This does not execute the blur method of the underlying elements! If you need to blur an element via code, you have to use the DOM method, eg. $("#myinput")[0].blur();" Sorry if I am not much help. -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: script killing IE
So I have determined that it's dying when I unbind and bind a new click function to that item. Where it starts: $(this).unbind();$ (this).click(function(){... When I commented this out, it works (of course it doesn't have that second click function). On Jun 4, 10:28 am, Shelane <[EMAIL PROTECTED]> wrote: > I have this script that is absolutely killing IE, but works fine in > FF. I wish I could post the working model, but it's behind our > firewall. > > Here's the script: > $(function(){ > bindResults = function(){ > $('#sbmsdata_1 a').click(function(){ > $('#sbmsdata_1 > img').attr('src','/images/sbms/folderclosed.gif'); > $('img', > $(this).parent().prev()).attr('src','/images/sbms/ > folderopen.gif'); > var linkval = $(this).attr('href'); > $(this).blur(); > $('#sbmsitems').load(linkval, function(){ > $('a', this).click(function(){ > $(this).blur(); > return false; > }); > }); > return false; > }); > } > var openfolder = 'none'; > loadSubjects = function(scope){ > $('a', scope).click(function(){ > > $('img','#sbmsdata_0').attr('src','/images/sbms/folderclosed.gif'); > var linkval = $(this).attr('href'); > $.post(linkval, function(j){ > $('table#sbmsdata_1').remove(); > $('#sbmsitems').empty(); > $(placement).append(j); > bindResults(); > }); > $(this).blur(); > var placement = $(this).parent(); > $('img', > $(this).parent().prev()).attr('src','/images/sbms/ > folderopen.gif'); > $(this).unbind(); > $(this).click(function(){ > > $('img','#sbmsdata_0').attr('src','/images/sbms/ > folderclosed.gif'); > $('table#sbmsdata_1').remove(); > $('#sbmsitems').empty(); > $(this).unbind(); > $(this).blur(); > loadSubjects($(this).parent()); > return false; > }); > if (openfolder != 'none'){ > $('a', openfolder).unbind(); > loadSubjects(openfolder); > } > openfolder = $(this).parent(); > return false; > }); > } > loadSubjects('#sbmssubjects'); > > });