Page 1 of 1

javascript popup images? are these possible?

Posted: Thu Jan 20, 2011 2:37 pm
by wilse
Hi folks


Sorry if this is in the wrong section, being a designer I'm quite a novice with coding.
I've had javascript popups [images] working in some Dreamweaver sites' but I'm unable to get the same functionality in CMSMS?

Can anyone please point/advise me if this is fairly easily achievable.


Basically I'd like a thumbnail image, when clicked can show a larger version of the same image.



Cheers

w

Re: javascript popup images? are these possible?

Posted: Thu Jan 20, 2011 3:23 pm
by wilse
OK...

Not being lazy think I've sorted it, BUT could someone knowledgeable tell me if this is the correct way to do the popup window?

I've added the following code into my 'template'

{literal}
<__script__ type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</__script>
{/literal}

Then I've used the following on the pages & images I need to enlarge.

<img onclick="MM_openBrWindow('uploads/images/Smallrough.jpg','popUp','')" src="uploads/images/Bigrough.jpg" alt="" width="98" height="136" />


Is this a good way or just stupid.


Cheers all

Re: javascript popup images? are these possible?

Posted: Thu Jan 20, 2011 4:42 pm
by Wishbone
I use 'fancybox' for this.

http://fancybox.net/

Re: javascript popup images? are these possible?

Posted: Thu Jan 20, 2011 5:51 pm
by janvl
Hi

how should the popup image look like?
Do you have an example of a site where I can see what exacly it is that you want?

Regards,
Jan

Re: javascript popup images? are these possible?

Posted: Fri Jan 21, 2011 10:47 am
by wilse
Thanks guys


I like the fancybox script being very new to CMSMS how easy is it to install this into my CMSMS site?


Jan
I haven't got anything specific, just wanted to have thumbnails that when clicked can open larger versions of the same image lets' say 600 x 600 px preferably in an auto sized window.

I'll investigate fancybox, but it looks a bit complex for me!


w

Re: javascript popup images? are these possible?

Posted: Fri Jan 21, 2011 1:12 pm
by janvl
Hi,
have a look at:
http://www.drhoenig-radiologie.at/
you can click on the 4 images of his certificates.

This is done with a smarty-tag like
{Lytebox href='uploads/images/zert-1-voll.gif' title='Urkunde 1' text=' ' thumbsrc='uploads/images/zert-1-kl.gif' lang="de_DE" resizeSpeed="5"}

Lytebox makes this a little easier, just install the module and put your own data in the tag.

Regards,
Jan

Re: javascript popup images? are these possible?

Posted: Thu Jan 27, 2011 12:56 pm
by wilse
Thanks all, finally went with Jan's suggestion for Lytebox.

It got me thinking:
If I wanted to user of the website [my client] to be able to insert images himself using the WYSIWYG editior, is it possible somehow automatically add the lytebox functionality to any new images he uploads?

Currently I have to insert...
{Lytebox href='uploads/images/campsites/campmap-large.jpg' text='' thumbsrc='uploads/images/campsites/campsmall.jpg' alt='Image #1'}
Which is OK for me, but not for a client?

wilse

Re: javascript popup images? are these possible?

Posted: Thu Jan 27, 2011 1:09 pm
by janvl
Hi,

I am afraid that what you ask, is not possible.
Write a simple instruction where the customer can give his images on the CMS
and use copy and paste.
That is the best advise I can give you, otherwise use the module "Gallery"

Kind regards,
Jan

Re: javascript popup images? are these possible?

Posted: Thu Jan 27, 2011 10:49 pm
by Dr.CSS
It is possible as most of these JS lightbox things only need something like rel='lightbox' in the link to make it happen and when adding image and link you can see in options or advanced tab a place to set this rel=...