advance of highslide gallery via jQuery -
this follow-up back upwards forum (thank 'roadrash' initial help!).
i have a highslide gallery in attempting advance next javascript/jquery. gallery has 70 images in it.
function changeimage() { var thevalue = $('#lstoptions2').val(); $('#thumb' + thevalue).trigger('click'); }
this works great while after 10 or 11 function calls images no longer advance. using chrome debugger i'm unable determine happening.
my questions are:
is there practical limit number of images in gallery. i using naming convention anchors non-consecutive. example, may have 1 named 'thumb3456' , next 'thumb5678' highslide expect anchors consecutive? is there method phone call missed in api select image index?if there no quick obvious reply happy post test link.
i can see dev gallery sent me you're using in-page gallery changing images using drop-down list in add-on regular thumbnails in thumbstrip.
this our regular in-page gallery: http://highslide.com/examples/gallery-in-page.html gallery is, highslide galleries, floating on top of page, in-page gallery has code prevent beingness closed.
this demo gallery created in our old forum: http://jsfiddle.net/roadrash/y5nza/ note gallery beingness closed onchange
each time take new image drop-down list.
onchange="document.getelementbyid(this.options[this.selectedindex].value).onclick(); hs.close()"
to create possible close gallery onchange
, have remove part in highslide settings:
// under no circumstances should static popup closed hs.expander.prototype.onbeforeclose = function() { if (/in-page/.test(this.wrapper.classname)) homecoming false; }
and add together this, since highslide can closed esc key - want prevent:
// prevent close gallery esc key hs.onkeydown = function (sender, e) { if( e.keycode == 27 ) homecoming false; };
you didn’t notice these of import differences between regular in-page gallery , demo gallery. issue dev gallery, opens new gallery each time take new image in drop-down list. can see little arrow below thumbnails in thumbstrip; should never more 1 arrow, in gallery there’s new arrow added each time take new image in drop-down list. i've created jsfiddle similar dev gallery: http://jsfiddle.net/7tsbe/ here it's easier see galleries beingness stacked on top of each other when using drop-down list open new images since images i’m using have different sizes. (this demo doesn't have top gallery opened onimageclick have in dev gallery.)
i can't set code need here, i've created new demo gallery similar dev gallery (with top gallery opened onimageclick). html markup same yours. of import changes in highslide settings, , there couple of more changes changes i've mentioned above. http://jsfiddle.net/roadrash/y5nza/1/
this part need add together hs.close();
in code (the line after changeimage();
). code doesn't same in demo page.
function setimageswatchevents() { $('#lstoptions').bind('change', function () { setimageswatches(1); }); $('#lstoptions2').bind('change', function () { setimageswatches(2); changeimage(); hs.close(); }); }
highslide
No comments:
Post a Comment