Soldato
Ah this is doing my nut in!
Basically have three image sizes per image:
thumb
preview
full
I've got 5 or so thumb nails. User clicks on a thumb nail and it loads the preview into the box below. They click on the preview and it pops up the image in a colorbox.
Problem: I can't do it! When I hook up the thumbnails to belong in the colorbox group, when you click on them it just opens up the colorbox. Don't worry about populating the right urls in the preview section (will be done in asp.net)... it's just the client side stuff thats wrecking my head. Any help would be greatly appreciated.
Where I've got too:
Basically have three image sizes per image:
thumb
preview
full
I've got 5 or so thumb nails. User clicks on a thumb nail and it loads the preview into the box below. They click on the preview and it pops up the image in a colorbox.
Problem: I can't do it! When I hook up the thumbnails to belong in the colorbox group, when you click on them it just opens up the colorbox. Don't worry about populating the right urls in the preview section (will be done in asp.net)... it's just the client side stuff thats wrecking my head. Any help would be greatly appreciated.
Where I've got too:
Code:
$(document).ready(function() {
$(".previewCb").click(function(event) {
// Stop the normal event (redirecting to a new window).
event.preventDefault();
// Open the colour box
$(".thumbCb").colorbox({
href: function() {
if ($(this).attr('href') != undefined)
return $(this).attr('href');
if ($(this).attr('src') != undefined)
return $(this).attr('src').replace("Thumb/", "").replace("Preview/", "");
return "";},
rel: 'thumbCb',
open: true
});
});
});
Code:
<div>
<img class="thumbCb" src="http://localhost/Thumb/image-1.jpg" />
<img class="thumbCb" src="http://localhost/Thumb/image-2.jpg"/>
<img class="thumbCb" src="http://localhost/Thumb/image-3.jpg" />
<img class="thumbCb" src="http://localhost/Thumb/image-4.jpg"/>
<img class="thumbCb" src="http://localhost/Thumb/image-5.jpg" />
</div>
<div >
<a class="previewCb" href="http://localhost/image-3.jpg">
<img src="http://localhost/storagelocationtwo/Preview/image-3.jpg"/>
</a>
</div>