It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

What am I doing wrong? HTML Frustrations

What am I doing wrong? HTML Frustrations

Postby cdc3323 on Mon Apr 16, 2007 11:55 pm

Hello,

I am trying to get my page to have image popups when I click on thumbnails. Here is my page http://www.brcphotography.com/holidaycards/index2.html

If you click on one of the links it it brings up the picture in another screen.

I would like it to work like this page EXAMPLE: http://209.66.101.242/EZ-Templates/calendars.php

See what happens when you click on one of the thumbs it put another image in the center of the screen.

Here is the code I have. Could you take a look at it and tell me what I have wrong. Thanks

<DIV align=center><A
onclick="return enlarge('http://www.bayphoto.com/catalog/detail/CL02.jpg',event,'center',300,375)"
href="http://www.bayphoto.com/catalog/detail/CL02.jpg"><IMG
alt=""
src="EZ-Templates calendar_files/CL02.gif"
border=0 name=thumbnail></A></DIV>
cdc3323
 
Posts: 12
Joined: Mon Apr 16, 2007 11:52 pm

Postby LucasZ21 on Tue Apr 17, 2007 3:20 pm

You know that to do that, you have to use javascript, right?

and that code you have is javascript, with a little bit of HTML in the mix.
Image
User avatar
LucasZ21
100+ Club
 
Posts: 195
Joined: Mon Feb 26, 2007 2:31 am
Location: Mansfield, OH

Postby jberry on Tue Apr 17, 2007 4:32 pm

This would be the javascript to use
Code: Select all
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


then you would use this to get the picture to show

Code: Select all
<td><div align="center"><a href="http://www.bayphoto.com/catalog/detail/CL01.jpg" onClick="return enlarge('http://www.bayphoto.com/catalog/detail/CL01.jpg',event,'center',300,375)"><img src="http://www.bayphoto.com/catalog/thumbs/CL01.gif" alt="" name="thumbnail" border="0"></a></div>


This is how it is done on the other page that you put up.
jberry
100+ Club
 
Posts: 144
Joined: Mon Mar 19, 2007 4:40 pm
Location: Atlantic City, NJ


Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests