Log in

View Full Version : How to add url link to fisheye widget images?



shakim
09-07-2006, 06:53 PM
I am using Dojo's Toolkit 0.3.


I am new to javascripting and webdev in general. This is the sample code I
am using. How do I make the image open up a url?





<div dojoType="FisheyeList"
itemWidth="40" itemHeight="40"
itemMaxWidth="150" itemMaxHeight="150"
orientation="horizontal"
effectUnits="2"
itemPadding="10"
attachEdge="center"
labelEdge="bottom"
>

<div dojoType="FisheyeListItem"
id="item1"
onclick="alert('click on' + this.caption + '(from widget id ' +
this.widgetId + ')!');"
caption="Item 1"
iconsrc="images/fisheye_1.png">
</div>

<div dojoType="FisheyeListItem"
caption="Item 2"
iconsrc="images/fisheye_2.png">

</div>

sandman
09-07-2006, 08:50 PM
newurl = 'http://www.thisweekontheinternet.com';
window.open(newurl, 'new window', 'resizeable=yes');

newurl could be a file name, image name or other supported document type.

shakim
09-08-2006, 03:17 PM
I'm sorry if I sound dumb. I am using an image. Can you give me an example using the above sample code?

sandman
09-08-2006, 03:41 PM
newurl = 'http://www.yourdomain.com/images/imgname.jpg';
window.open(newurl, 'new window', 'resizeable=yes');

shakim
09-08-2006, 06:35 PM
Thank you for your help. If possible, I a a bid more. Now that I have gotten the url to open when the image is clicked I need to take it a step further. I have decided to incooperate the greybox effect, ( http://orangoo.com/labs/GreyBox/ ) when the url is lauched. The code that I am using to lauch an url is as follows:



<div dojoType='FisheyeListItem'
iconsrc='images/picturegallery.png'
onclick='window.open("index.html","center");' >
</div>



The code that make the lighbox effect is as follows:




<a href="http://amix.dk/" onclick="return GB_showFullScreen('amix.dk', 'http://amix.dk/')">Show amix.dk in full screen</a>




How can I add this code to the fisheye widget.


P.S. - Basically what I am trying to accomplish is create a site that have a index page with the fisheye widget from dojo. Then the images are linked to subpages. But I don't want just regular popup screen, I want the subpages to load in a lightbox/greybox way.