0

わかりました、ページ上のすべての画像を見つけてブックマークレットに表示するブックマークレットに単純なjavascript関数があります

for(var i=0; i<img_find.length; i++)
        {
            if (theImg[i].width > 200 && theImg[i].height > 200)
            {
                $("#image").append("<img id='photo' height='150' src='"+img_find[i]+"'/>");
                $("#width").append("<input type='hidden' value='"+img_find[i]+"' name='story_img'/>");
            }
        }

jquery スライドショーもあるので、[次へ] をクリックして画像をスクロールできます。

ユーザーがスライドショーで見ている現在の画像を入力値に入れる方法はありますか?

$('.slideshow').cycle({ 
        prev:   '#prev', 
        next:   '#next', 
        timeout: 0 
    });

<div id='image' class='slideshow' align='left'></div>
<a href='#' id='prev' style='font-size:10px;'>Previous</a>
<a href='#' id='next' style='font-size:10px;'>Next</a>

ありがとう!

4

1 に答える 1

0

http://jquery.malsup.com/cycle/int2.htmlに従って

before: 関数を追加するだけです

$('.slideshow').cycle({ 
        prev:   '#prev', 
        next:   '#next', 
        before:  onBefore
        timeout: 0 
    });

function onBefore() { 
    $('#output').html("Scrolling image:<br>" + this.src); 
} 
于 2011-05-16T03:18:03.247 に答える