473,396 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

popUp dimension...

hi,
in one folder i've put all pics, but they are not all the same size. i've
got as many links as pics and clicking on link popUp opens showing that pic.
now, i would like to have one function that opens popUp window but in
different dimension for different pic.
i.e.
<A href="#"
onClick="javascript:window.open('/path/pic.jpg','','width=[PIC.WIDTH],height
=[PIC.HEIGHT],
toolbar=0,location=0,directories=0,menuBar=0,scrol lBars=no,resizable=1');">
<STRONG>Enlarge pic</STRONG></A>

how can i get PIC.WIDTH and PIC.HEIGHT?
thanks
Jul 20 '05 #1
5 1574
Hi,

check http://bugimus.com/gurus/image_popup/imagepopup.html

--
Elias
http://lgwm.org/

"riki" <ri******@hotmail.com> wrote in message
news:br**********@ls219.htnet.hr...
hi,
in one folder i've put all pics, but they are not all the same size. i've
got as many links as pics and clicking on link popUp opens showing that pic. now, i would like to have one function that opens popUp window but in
different dimension for different pic.
i.e.
<A href="#"
onClick="javascript:window.open('/path/pic.jpg','','width=[PIC.WIDTH],height =[PIC.HEIGHT],
toolbar=0,location=0,directories=0,menuBar=0,scrol lBars=no,resizable=1');"> <STRONG>Enlarge pic</STRONG></A>

how can i get PIC.WIDTH and PIC.HEIGHT?
thanks

Jul 20 '05 #2
@SM
riki a ecrit :
i would like to have one function that opens popUp window but in
different dimension for different pic.


<script type="text/javascript"><!--
truc=false;
function pop(larg,haut){
if(truc!=false || !truc.closed){truc.close(); truc=false;}
else
truc=window.open('','VoirIci','width='+larg+',heig ht='+haut',resizable=1');
}
// --></script>
<a href="../path/image_1.jpg" target="VoirIci"
onclick="pop(245,123);">Image 1</a>

If JS is unactive ==> a new window will open
If JS ==> a new nake window with right dimensions will open
and the html will send the image to the target "VoiIci" wich is in the popup.

--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
************************************************** ************
Jul 20 '05 #3
<script type="text/javascript"><!--
truc=false;
function pop(larg,haut){
if(truc!=false || !truc.closed){truc.close(); truc=false;}
else
truc=window.open('','VoirIci','width='+larg+',heig ht='+haut',resizable=1'); }
// --></script>
<a href="../path/image_1.jpg" target="VoirIci"
onclick="pop(245,123);">Image 1</a>


yes, but now i have to manualy insert width and height in the
pop(width,height) function and i would like something like this if it is
possible

onclick="pop(getImage[imgPath/imgName].getWidth,
getImage[imgPath/imgName].getHeight);">Image 1</a>

i don't know if i explained it right.
thanks.


Jul 20 '05 #4
@SM
riki a ecrit :
yes, but now i have to manualy insert width and height in the
pop(width,height) function and i would like something like this if it is
possible

onclick="pop(getImage[imgPath/imgName].getWidth,
getImage[imgPath/imgName].getHeight);">Image 1</a>


<SCRIPT LANGUAGE="JavaScript">
/*
SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT
http://www.editeurjavascript.com
Ne copiez ce code qu'une fois dans votre page
Copy this code only once in your page
*/
function afficheVignette(cheminVignette,cheminMaxi)
{
document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+
'\')"><IMG SRC="'+cheminVignette+
'" HSPACE=0 VSPACE=0 BORDER=0 ALT="cliquez ici pour voir en grand"></A>');
}
function afficheMaxi(chemin) // chemin = path to big photo file
{
i1 = new Image;
i1.src = chemin;
html = '<HTML><HEAD><TITLE>Image</TITLE></HEAD>'+
'<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>'+
'<CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="'+
window.resizeTo(document.imageTest.width,document. imageTest.height)">'+
'</CENTER></BODY></HTML>';
popupImage = window.open('','_blank','menuBar=0,scrollbars=0,re sizable=1');
popupImage.document.open();
popupImage.document.write(html);
popupImage.document.close()
};
</SCRIPT>

To use this script :
insert in your page each time there where you need an image "zoommable"
<p><SCRIPT LANGUAGE="JavaScript">
affiche('path_thumbnails/Img1.jpg','path_tall_Photos/Img1.jpg');
</script>
<p><SCRIPT LANGUAGE="JavaScript">
affiche('path_thumbnails/Img2.jpg','path_tall_Photos/Img2.jpg');
</script>

could be replaced by :
<A HREF="javascript:afficheMaxi('path_big_Photos/Img1.jpg');
"><IMG SRC="path_thumbnails/Img1.jpg" HSPACE=0 VSPACE=0 BORDER=0
ALT="Clicable picture" TITLE="Click me to see me in tall"></A>
<A HREF="javascript:afficheMaxi('path_big_Photos/Img2.jpg');
"><IMG SRC="path_thumbnails/Img2.jpg" HSPACE=0 VSPACE=0 BORDER=0
ALT="Clicable picture" TITLE="Click me to see me in big"></A>

You probably will have to adapte to be compatible with DOM

--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephanePOINTmoriaux/internet/
************************************************** ************
Jul 20 '05 #5
thank you very much
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Steve Jorgensen | last post by:
Hi all, I'm working on the schema for a database that must represent data about stock & bond funds over time. My connundrum is that, for any of several dimension fields, including the fund name...
2
by: Jason . | last post by:
Is there a way to dynamically size a popup object? i.e. function getMetricDesc(sDescription) { var oPopup = window.createPopup(); var oPopupBody = oPopup.document.body; oPopupBody.innerHTML = ...
4
by: Michael Kirchner | last post by:
Hi everybody The output of my multiple dimension array is quite confusing. Im declaring an array, store some values in it and then I save the array in a session variable. On an other page I...
1
by: Lo?c Henry-Gr?ard | last post by:
Hi, I'm using a homebrew, lightweight version of SIunits, the physical dimension checker. For example I define types such as m (meters), s (seconds) and mps (meters per second) in namespace SI...
9
by: James | last post by:
Hi, I am new to C++. I want to directly create a dynamic two-dimension double array, i.e. double pp. I found the "new" is only for one-dimension array, i.e. double *p = new p. How to "new" a...
2
by: Nathan Sokalski | last post by:
I have a multidimensional array declared as the following: Dim guesses(14, 5) As Integer I want to assign all values in a specific dimension to another array declared as follows:
5
by: Jackson | last post by:
I have something that is stumping me. I am trying to initialize a 3 dimensional string array with the code below, but it wont compile. Can anyone explain what Im doing wrong?????????????? Im...
3
by: simora | last post by:
Hi: Need some working sample code to post hidden form data from a php page to a new popup window. 540 x 500 centered. The popup that I'm calling already is formatted and has a TITLE:web-2007.php...
1
by: dheepakk | last post by:
Hi All, When a mouseover event takes place over a link the popup window is displayed. I also have a mouseout on the link.So if the popup window comes up,has a dimension such that the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.