Widget:A2Sequence: Unterschied zwischen den Versionen

aus Kamelopedia, der wüsten Enzyklopädie
Zur Navigation springen Zur Suche springen
 
(2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
 
  <script>
 
  <script>
 
  var goto = parseInt("<!--{$goto|escape:'javascript'}-->");
 
  var goto = parseInt("<!--{$goto|escape:'javascript'}-->");
  if ($("#a2image").length && $("#a2textSequence").length) {
+
var nextPage = function() {
 +
    clearInterval(a2.sequenceInterval);
 +
    $("#a2text").empty();
 +
    if ("<!--{$goto|escape:'javascript'}-->")
 +
        a2.util.goto(goto);
 +
};
 +
 
 +
  if ($("#a2textFrame").length && $("#a2textSequence").length) {
 
     a2.log("a");
 
     a2.log("a");
     $("#a2image").css("overflow","hidden").css("font-size","200%").css("position","relative");
+
     $("#a2textFrame").css("overflow","hidden").css("font-size","200%").css("position","relative");
     var h=$("#a2image").height() + $("#a2image").offset().top;
+
     var h=$("#a2textFrame").height() + $("#a2textFrame").offset().top;
 
     $("#a2textSequence").offset({top:h});
 
     $("#a2textSequence").offset({top:h});
  
    // don't know, why this does not work ...
 
 
     var $link = $('<a class="pseudolink">Sequenz überspringen</a>');
 
     var $link = $('<a class="pseudolink">Sequenz überspringen</a>');
 
     $("#a2text").empty().append($link);
 
     $("#a2text").empty().append($link);
     $link.click(function(){a2.util.goto(goto);});
+
     $link.click(function(){
 +
        nextPage();
 +
    });
 
   
 
   
 
     a2.sequenceInterval = setInterval(function () {
 
     a2.sequenceInterval = setInterval(function () {
        a2.log("interval");
 
 
         if (!$("#a2textSequence").length) {
 
         if (!$("#a2textSequence").length) {
 
             clearInterval(a2.sequenceInterval);
 
             clearInterval(a2.sequenceInterval);
Zeile 23: Zeile 30:
 
             $("#a2textSequence").offset({top:n});
 
             $("#a2textSequence").offset({top:n});
 
         } else {
 
         } else {
             clearInterval(a2.sequenceInterval);
+
             nextPage();
            $("#a2text").empty();
 
            if ("<!--{$goto|escape:'javascript'}-->")
 
                a2.util.goto(goto);
 
 
         }
 
         }
 
     }, 120);
 
     }, 120);

Aktuelle Version vom 27. August 2012, 21:09 Uhr

<script>
var goto = parseInt("");
var nextPage = function() {
    clearInterval(a2.sequenceInterval);
    $("#a2text").empty();
    if ("")
        a2.util.goto(goto);
};
if ($("#a2textFrame").length && $("#a2textSequence").length) {
    a2.log("a");
    $("#a2textFrame").css("overflow","hidden").css("font-size","200%").css("position","relative");
    var h=$("#a2textFrame").height() + $("#a2textFrame").offset().top;
    $("#a2textSequence").offset({top:h});
    var $link = $('<a class="pseudolink">Sequenz überspringen</a>');
    $("#a2text").empty().append($link);
    $link.click(function(){
        nextPage();
    });

    a2.sequenceInterval = setInterval(function () {
        if (!$("#a2textSequence").length) {
            clearInterval(a2.sequenceInterval);
            return;
        }
        if($("#a2textSequence").position().top > - $("#a2textSequence").height()) {
            var n = $("#a2textSequence").offset().top - 2;
            $("#a2textSequence").offset({top:n});
        } else {
            nextPage();
        }
    }, 120);
} else {
    a2.log("b");
}
</script>