On May 1, 1:21 pm, Laker Netman <[email protected]> wrote:
> On May 1, 9:11 am, Laker Netman <[email protected]> wrote:
>
>
>
> > I was hacking together a quick example of flipping between product
> > details for a commerce site I'm developing on and found a consistent
> > crash using IE7 (FF3.0.10 and Safari 3.2.2 have no problem).
>
> > I have two DIVs laid out identically, except for the text and image
> > content. The first DIV is displayed when the page loads, the second is
> > hidden (display: none). When I click on a graphic set up to display
> > DIV #2 everything is fine, when I click on it again to return to DIV
> > #1 the browser crashes. I'm guessing the problem lies with how I am
> > swapping the DIVs, but it seems odd the browser itself is completely
> > dying.
>
> > Here's my "DIV swap" snippet:
> >         $("#navLeft,#navRight").click(function() {
> >                 $("#productDetail").fadeOut("slow");
> >                 $newProduct = $("#productDetail2");
> >                 $("#productDetail").attr("id","productDetail2").attr
> > ("display","none");
> >                 
> > $newProduct.attr("id","productDetail").attr("display","visible");
> >                 $newProduct = null;
> >                 $("#productDetail").fadeIn("slow");
> >         });
>
> > #productDetail2 is the (initially) hidden DIV. Whichever DIV is
> > visible must have the ID #productDetail (due to other code links), so
> > I swap the IDs using $newProduct as an intermediary.
>
> > Am I specifically doing something wrong that's bad enough to justify
> > the browser completely bombing? Or did I uncover a(nother) flaw in
> > IE :)
>
> > TIA,
> > Laker
>
> Whoops, pasted an older chunk of code by accident, here's the current
> version:
>
>         $("#navLeft,#navRight").click(function() {
>                 $("#productDetail").fadeOut("slow");
>                 $newProduct = $("#productDetail2");
>                 $("#productDetail").attr("id","productDetail2").attr
> ("display","none");
>                 
> $newProduct.attr("id","productDetail").attr("display","block");
>                 $("#productDetail").fadeIn("slow");
>         });

It probably has to do with you switching IDs - both elements end up
with the same ID for a short moment. Try setting a classname or other
attribute instead.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to