Forums › Forums › Slimbox2 plugin › making images in a set unique
- This topic has 4 replies, 2 voices, and was last updated 15 years, 7 months ago by
malcalevak.
-
AuthorPosts
-
January 17, 2009 at 10:47 pm #544
Anonymous
MemberAccording to http://transientmonkey.com/wp-slimbox2/ … omment-148 I mangaged to get all image links of a single post collected into on image set.
Now I’d like to make them unique, so that if an image link occurs repeatedly across the post, the image appears only once in the image set displayed by slimbox.
Any ideas how to do that?
January 18, 2009 at 4:10 am #4686malcalevak
ModeratorThe feature to collect all images into a set by post was actually implemented in the release that came out shortly before your post.
Regarding your request, I honestly don’t have a clue how to do it, and it may actually fit better as a question for the Slimbox creator, Christophe Beyls at http://groups.google.com/group/slimbox-support though I’m not sure you’ll get any luck there.
Thinking about it myself, though, it seems likely that doing so would involve a great deal of overhead (though I could be mistaken).
If you do find a way to do it, I be very interested in seeing it, preferably it would be written to utilize jQuery.
January 27, 2009 at 12:17 am #4687Anonymous
MemberHi,
I manged by modifying slimbox.js myself:
Here’s the code snippet I inserted into slimbox.js
[code:3oxbzxu5]
// (Zellner, 2009-01-27) make images unique:
// leave only the first occurence of an image in _images.
//
for (var i = _images.length – 1; i >= 0; i–) {
var i1_url = _images[i][0];
for (var j = i – 1; j >= 0; j–) {
if (_images[j][0] == i1_url) {
if (startImage == i)
startImage = j;
_images.splice(i, 1);
break;
}
}
}
[/code:3oxbzxu5]
I’ll also attach the complete file.I’d suggest to make this an option.
I’ll also post this to http://groups.google.com/group/slimbox-supportJanuary 27, 2009 at 1:08 am #4688malcalevak
ModeratorI added code tags to make that easier to read.
I’ll have to take some time to look at it later to figured out exactly what it’s doing and possibly rewrite it using jQuery, but we’ll see.
Could you provide an example of where this is being used?
January 29, 2009 at 4:30 am #4689malcalevak
ModeratorDr. Zellner,
Could you show a demo of this in action, to better help me visualize what it’s doing? I think I know, but a demo would help a lot.
Also, are you doing to insist on the credit comment being with the code portion, or would you be content with credit being listed in the thanks area – specifically stating why – where I typically put credit for assistance such as this?
-
AuthorPosts
- You must be logged in to reply to this topic.