Joel
Joel

Reputation: 2215

IE7/8, jQuery ui sortable, and hiding content. O.o

So I've been having weird problems with jQuery sortable. I've got sortable li elements, which sort fine, however in IE, when dragging, the images disappear. I'm fairly sure they just get positioned weirdly but it doesn't seem to happen in any other browsers, other times the whole content within will disapear.

Now I found a fix to this, refreshing the html using;

$(this).html($(this).html());

This seems to fix the IE crapness, however in other browsers (and not IE), the values of form elements get reset when this is done.

Anyone have any suggestions?

Cheers

Upvotes: 2

Views: 787

Answers (2)

Raiden
Raiden

Reputation: 135

You can use this code

    if ($.browser.msie && $.browser.version.substring(0,1) <= '7') {
        $(this).html($(this).html());
    }

for targeting IE in jQuery.

Upvotes: 1

Joel
Joel

Reputation: 2215

My solution was to run a javascript function called "ResetHtml()", then define the function in a php file, forcing only IE to do;

$(this).html($(this).html());

And leaving the other browsers as they were.

Thanks for your suggestions as always :)

Upvotes: 0

Related Questions