joeblack9988 / slideshow

Automatically exported from code.google.com/p/slideshow
0 stars 0 forks source link

Hyperlink on images #207

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi there!

We are currently using slideshow2! in one of our websites and we are trying to 
apply separate hyperlinks on images to open in a new window.
The issue that we are having is that once we apply a hyperlink to an image and 
set it to open in a new window, it appears to replicate that through all the 
images within the set.
We currently have it set up where it does not use the array, but calls it from 
the div:

<script type="text/javascript">     
      window.addEvent('domready', function(){
        var myShow = new Slideshow('show', null, {controller: true, height: 311, thumbnails: false, width: 564});
      });
    </script>

I looked up some info on the wiki and the FAQ, but that all uses the array to 
put in the hyperlinks.

We are using the latest version of slideshow that works with mootools 1.3.XXX

Let me know if this doesn't make any sense or if you need more info.

Thanks for any help offered!

Original issue reported on code.google.com by scottyd...@gmail.com on 21 Jun 2011 at 10:11

GoogleCodeExporter commented 8 years ago
To understand, you would only like certain images to open in a new window, not 
all of them?

Original comment by aeron.gl...@gmail.com on 1 Jul 2011 at 12:51

GoogleCodeExporter commented 8 years ago
Correct.

For example, if there are 5 images in the slideshow each image would have a 
separate hyperlink to a different URL and then open in a new window/tab.

Original comment by scottyd...@gmail.com on 1 Jul 2011 at 1:36

GoogleCodeExporter commented 8 years ago
The slideshow should handle this already:

var data = {
'image1.jpg': {'href': 'http://somewhere.com'},
'image2.jpg': {'href': 'http://somewhere_else.com'}
}
new Slideshow('show_id', data);

If you want the images to open in a different window, then in the HTML:

<div id="show_id" class="slideshow">
  <a target="_blank">
    <img src="default/image.jpg" />
  </a>
</div>

Slideshow will inherit any properties in the existing HTML. So if the existing 
anchor has a target, so will Slideshow. But the hrefs, the actual links for 
each image, needs to be set in the data passed into the show on initialization.

Original comment by aeron.gl...@gmail.com on 1 Jul 2011 at 3:22

GoogleCodeExporter commented 8 years ago
Ahhh.

Well, the issue is that the slideshow is nested into a CMS and we have it set 
up where the images don't use the JS array.  The are called up within the DIV 
so that the users who edit the site in the CMS and just upload the images and 
place it in the WYSIWYG editor and save it.  So they are adding the hyperlinks 
on the images within the CMS editor.

I hope that makes sense.

Original comment by scottyd...@gmail.com on 1 Jul 2011 at 3:32

GoogleCodeExporter commented 8 years ago

Original comment by aeron.gl...@gmail.com on 11 Jul 2011 at 3:39