
March 13th, 2008, 03:01 AM
|
 |
Text Ninja
|
|
Join Date: Jun 2005
Location: Vancouver, British Columbia, Canada
|
|
What is the pattern you're using for the image names? Say we have a video located here: vids/redhead-lesbian-nurse-bukkake-34.flv. You'll need to save the slideshow images according to some rigidly defined pattern, like such: slides/redhead-lesbian-nurse-bukkake-34/1.jpg, slides/redhead-lesbian-nurse-bukkake-34v/2.jpg, slides/redhead-lesbian-nurse-bukkake-34/3.jpg. The number of screenshots per video must also remain constant.
Now, if you feel the need to invoke rule thirty four on an entire gallery of pictures in a div named "tgp-gallery", a bit of simple looping will go a long way:
javascript Code:
Original
- javascript Code |
|
|
|
onload = function() { var secondsBetweenSlides = 0.5; var slidesPerImage = 5; var gallery = document.getElementById("tgp-gallery"); // grab the container div var pornLinksInGallery = gallery.getElementsByTagName("a"); for (var i = pornLinksInGallery.length - 1; i >= 0; i--) { (function() { var img = pornLinksInGallery[i].firstChild; if (img && img.tagName && img.tagName.toLowerCase() == "img") { var match = null; if (match = img.href.match(/^(slides\/.*)\//)) { var cycleImage = function(n) { if (typeof n != "number") { img.currentImage = img.currentImage || 0; img.currentImage++; } else { img.currentImage = n; } img.currentImage = img.currentImage % slidesPerImage; img.src = match + "/" + (img.currentImage + 1) + ".jpg"; } img.onmouseover = function() { img.interval = setInterval(cycleImage, secondsPerSlide * 1000); }; img.onmouseout = function() { if (img.interval) { clearInterval(img.interval); cycleImage(0); } }; } } })(); } }
html4strict Code:
Original
- html4strict Code |
|
|
|
<li><a href="vids/interracial-moneyshot-yummy-4245.flv"><img src="slides/interracial-moneyshot-yummy-4245/1.jpg" /></a></li> <li><a href="vids/blonde-redhead-licking-3472.flv"><img src="slides/blonde-redhead-licking-3472/1.jpg" /></a></li> <li><a href="vids/toys-star-hard-and-fast-5512.flv"><img src="slides/toys-star-hard-and-fast-5512/1.jpg" /></a></li> <li><a href="vids/licking-milf-brunette-273.flv"><img src="slides/licking-milf-brunette-273/1.jpg" /></a></li> <li><a href="vids/fist-mouth-lesbian-4877.flv"><img src="slides/fist-mouth-lesbian-4877/1.jpg" /></a></li> <li><a href="vids/behind-sofa-blowing-1001.flv"><img src="slides/behind-sofa-blowing-1001/1.jpg" /></a></li> </ul> </div>
Now, I haven't tested any of the above code, and you'll probably want to preload the images and change the naming/markup structure (and, by association, the logic of the loop)... But I hope it's enough to give you some clues and a place to begin. Good luck.
|