質問

私は問題を抱えています。私は(それが一定のdivに表示されますように、ユーザーから見た)ボタンが押されたときにカウンタを更新したいと思います。ボタンが押されたときにこれが起こります:

$("#photo-counter span").empty().append((start_index+1)+"-"+(end_index+1)+" / "+files.length);  
sIFR.replace(netto, { selector: "#photo-counter span"});
としては初めてで、この自動的に実行し、すべてが正常に動作しますが、私はボタンをクリックしたときにdivsIFRによって置き換えられることはありません。

缶誰ヘルプ?

役に立ちましたか?

解決

あなたが実際にこれを行うことができます:

sIFR.replacements["#photo-counter span"][0].replaceText((start_index+1)+"-"+(end_index+1)+" / "+files.length);

HTMLを更新する必要はあり、sIFRはあなたのためにことをすべての世話をしない。

他のヒント

その他のコードでは、これを解決するために有用である可能性があります。

とにかく、ここでショットがあります:

ライブクリックにあなたのクリックを変更します:

$('#yourElement').live('click', function(){
    $("#photo-counter span").empty().append((start_index+1)+"-"+(end_index+1)+" / "+files.length);  
    sIFR.replace(netto,{
        selector: "#photo-counter span"
    });
});

希望このことができます!

ここでは、完全なコードがあります:

$("#arrow-left").mouseup(function() {
if(!$("#frame > *").is(":animated") && status != "fullscreen"){
$(this).css({"opacity":"1.0"});

arrowClick("left");
}};

function arrowClick(direction) {
(...) /* i dont think the problem is located somewhere here */
refreshCounter(start, end);
(...)
}

function refreshCounter(start_index, end_index) {
if(files.length > 0) {
start_i = start_index;
end_i = end_index;
if(start_index !=null && end_index != null) {
$("#photo-counter span").empty().append((start_index+1)+"-"+(end_index+1)+" / "+files.length);  
sIFR.replace(netto, { selector: "#photo-counter span"});
}
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top