Complete fix for bug #13

Create issue
Issue #14 resolved
Former user created an issue

Line #14 var $overlay, $wrapper, $container, $superbox, $closeBtn, $loading, $nextprev, $nextBtn, $prevBtn, settings, $content, $contentParent,

Line #258 $content = $($elt.attr('href')).clone(); $contentParent = $($elt.attr('href')).parent(); $($elt.attr('href')).clone().appendTo($innerbox).show(); $($elt.attr('href')).remove();

Line #380 $content.appendTo($contentParent);

Angel Ruiz

Comments (7)

  1. Former user Account Deleted

    Sorry, for line #258 $content = $($elt.attr('href')).clone(); $contentParent = $($elt.attr('href')).parent(); $content.appendTo($innerbox).show(); $($elt.attr('href')).remove();

    in order to work in IE too

  2. Former user Account Deleted

    Sorry again, but usually you want to clone also the event handlers:

    line #258 $content = $($elt.attr('href')).clone(true); $contentParent = $($elt.attr('href')).parent(); $content.appendTo($innerbox).show(); $($elt.attr('href')).remove();

  3. Former user Account Deleted

    Last version from line #258.

    I was force to to do the following because sometimes IE7 returns the href with the hole URL:

    var contentSelector = $elt.attr('href'); contentSelector = contentSelector.substring(contentSelector.lastIndexOf("#")); $content = $(contentSelector).clone(true); $contentParent = $(contentSelector).parent(); $content.appendTo($innerbox).show(); $(contentSelector).remove();

  4. Former user Account Deleted

    sorry, I meant that "...sometimes IE7 returns the whole URL...", because it interprets the href="#whatever" as an anchor and not as a CSS selector (wich is correct), but sometimes it tries to be smarter that you and it gives you the absolute URL. This happened to me when reoloading the anchor using Ajax. So before and after using Ajax I get different content from the jQuery sentence: $elt.attr('href'). Before I get the correct content: #whatever, but after doing the Ajax request I got: http://whatever#whatever.

    Previous patch solve the problem with IE7.


    Angel Ruiz.

  5. Log in to comment