Efekt jQuery UI powoduje przeładowanie iframe

Używam jQuery, aby pokazać / ukryć div, który zawiera zawieszenie iframe. Świetnie działa ze standardowymi metodami „show” i „hide”.

Więc teraz chcę uzyskać trochę fantazji i dodać kilka efektów z interfejsu użytkownika jQuery (http://jqueryui.com/effect/) ale nagle moje iframe są przeładowywane za każdym razem, gdy je pokazuję / ukrywam.

Oto skrzypce, aby pokazać:http://jsfiddle.net/BnZzk/1/ A oto kod, ponieważ SO zmusza mnie do dodania go:

<style>
div {
    height: 200px
}
span {
    display: block;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid black;
}
</style>

<div>
    <iframe src="http://www.wikipedia.org/"></iframe>
</div>
<input type="button" value="Go"/>
<hr/>
<div id="msgs"></div>

<script>
$(function () {

var container = $('div'),
    ifrm = $('iframe'),
    msgs = $('#msgs')
    delay = 10; //change me to adjust delay in seconds between actions

$('input').on('click', normal);
log('First let the iframe load and then clear your network console -- click the "Go" button to get started.');

function log (msg) {
    msgs.append('<span>' + msg + '</span>');
}

function normal () {

    ifrm.
        hide(400, function () {

            log('That was a standard hide with no effect -- is your network console still empty? OK we\'ll pause for ' + delay + ' seconds and then do a standard show.');

            ifrm.
                delay(delay * 1000).
                show(400, function () {
                    log('That was a show with no effect -- is you network console *still* empty? Great! Let\'s try some effects.');
                    log('------------------------<br/>' +
                    '-- Begin Effects --<br/>' +
                    '------------------------<br/>');
                    withEffect();
                });

        }); //hide

} //normal

function withEffect () {

    log('We\'ll pause for another ' + delay + ' seconds -- get ready to watch your network console.');

    ifrm.
        delay(delay * 1000).
        hide('fold', {mode:'hide'}, 400, function () {

            log('That was a hide with effect -- is your network console flooded? Mine too :-( We\'ll wait ' + delay + ' seconds while you clear your console again.');

            ifrm.
                delay(delay * 1000).
                show('fold', {mode:'show'}, 400, function () {
                    log('That was a show with effect -- is your network console flooded again? Bummer ...');
                });

        }); //hide

} //withEffect

});
</<script>

Jakiś pomysł, jak mogę zachować wymyślne efekty, ale nie odświeżam zawartości moich ramek?

questionAnswers(2)

yourAnswerToTheQuestion