467,104 Members | 964 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,104 developers. It's quick & easy.

how to pop out same image without html from html background...

100+
Hi All,

I have this html code below. Just like to check what is a good way to pop up an same image of its own(without new html page, but an image on top of current html page) by click on the image of the original html page?

Sample code is below. And I wanted to use this in perl, not sure if it is workable?


Thanks in advance,
Andrew


Expand|Select|Wrap|Line Numbers
  1.  
  2. Expand|Select|Wrap|Line Numbers <div class="centerBoxContentsNew centeredContent back" style="width:33%;"><a href="01.jpg"><img  
  3.  
  4. src="02.JPG" alt="RHB_CNLIN0003-SILVER" title="" width="60" height="80" style="position:relative"  
  5.  
  6. onmouseover="showtrail('02.jpg','RHB_CNLIN0003-SILVER',60,80,187,249,this,0,0,60,80);"  
  7.  
  8. onmouseout="hidetrail();"  /></a><br /><a href="01.jpg">RHB_CNLIN0003-SILVER</a><br />US$15.00</div> 
  9. <br class="clearBoth" /> 
  10.  
  11.  
Nov 3 '08 #1
  • viewed: 4503
Share:
6 Replies
KevinADC
Expert 2GB
This question has nothing to do with perl and should be directed to the proper forum, the html or javascripting forum.
Nov 3 '08 #2
100+
Hi Kevin,

Thanks again... I resolved the code except for I could not let it pop on windows by itself, it popped out in separate html page.

Also, I want to check if the below html can incorporate into Perl and how?? As the code seemed to be Java based??


Thanks and Best Rgds,
Andrew


Expand|Select|Wrap|Line Numbers
  1. <div class="centerBoxContentsNew centeredContent back" style="width:33%;"><a href="0001.jpg"><img   
  2.  
  3. src="0001.jpg" alt="RHB_CNLIN0003-SILVER" title="" width="60" height="80" style="position:relative"   
  4.  
  5.  
  6. onmouseout="hidetrail();"  /></a><br /><a href="0002.jpg">RHB_CNLIN0003-SILVER</a><br />US$15.00</div>  
  7. <br class="clearBoth" />  
  8.  
  9.  
Nov 3 '08 #3
KevinADC
Expert 2GB
You put it into perl code the same way you are putting all html code into your perl script. It looks like javascript, not java.
Nov 3 '08 #4
100+
Hi Kevin / All,

I tried to incorporate Java script into html and perl as pop up screen in html from my picture but cant work, not sure what is the issue??? The main html page which supposed to activate the perl script showed blank...


Thanks in advance again,
Andrew


Hi all,

I have enabled Javascripting in internet explorer 7, and I have been writing script in perl.

The thing I cant do now is to pop up image in small html frame from main html page.... The result of the main html showed blank. Any idea?


Thanks and Best Rgds,
Andrew


a) html script - not sure if the directory perl is correct, put into cgi-bin directory in perl but cant work, so put into d drive...
==============================

Expand|Select|Wrap|Line Numbers
  1.  
  2. <html> 
  3.    <head> 
  4.      <script src="d:testjava-mod.js"> 
  5.      </script>   
  6.  
  7.    </head> 
  8.  
  9.    <body>
  10.    </body>
  11. </html>
  12.  
  13.  

javascript(changed to d drive from perl default script directory still cannot activate script)
========
Expand|Select|Wrap|Line Numbers
  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Java Popup Window Example with size, title and background colour parameters</TITLE>
  5. <script language="JavaScript1.2" type="text/javascript">
  6. <!-- ;
  7. var newwindow;
  8. var wheight = 0, wwidth = 0;
  9.  
  10. function popitup5(url, title, iwidth, iheight, colour) {
  11. var pwidth, pheight;
  12.  
  13. if ( !newwindow || newwindow.closed ) {
  14. pwidth=iwidth+30;
  15. pheight=iheight+30;
  16. newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
  17. wheight=iheight;
  18. wwidth=iwidth;
  19. }
  20.  
  21. if (wheight!=iheight || wwidth!=iwidth ) {
  22. pwidth=iwidth+30;
  23. pheight=iheight+90;
  24. newwindow.resizeTo(pwidth, pheight);
  25. wheight=iheight;
  26. wwidth=iwidth;
  27. }
  28.  
  29. newwindow.document.clear();
  30. newwindow.focus();
  31. newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
  32. newwindow.document.writeln('<img src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" >');
  33. newwindow.document.writeln('<\/center> <\/body> <\/html>');
  34. newwindow.document.close();
  35. newwindow.focus();
  36. }
  37.  
  38. // Routines to tidy up popup windows when page is left
  39. // Call with an onUnload="tidy5()" in body tag
  40.  
  41. function tidy5() {
  42. if (newwindow && !newwindow.closed) { newwindow.close(); }
  43. }
  44.  
  45. // Based on JavaScript provided by Peter Curtis at www.pcurtis.com -->
  46. </script>
  47.  
  48.  
  49. </HEAD> 
  50.  
  51. <BODY onUnload="tidy5()" > 
  52.  
  53. <A HREF="javascript:popitup5('d:0002.jpg','Temple of Heavenly Bliss', 384, 288,'white')"><IMG SRC="d:0002.jpg" WIDTH="160" BORDER="0" HEIGHT="120" HSPACE="10" VSPACE="5" ALT="Temple of Heavenly Bliss" TITLE="Temple of Heavenly Bliss" ALIGN=left></A> 
  54.  
  55. </BODY>
  56. </HTML>
  57.  
Nov 4 '08 #5
100+
Hi Kevin / All,

I tried to incorporate Java script into html and perl as pop up screen in html from my picture but cant work, not sure what is the issue??? The main html page which supposed to activate the java script in perl cgi-bin directory showed blank, changed the javascript to drive with the picture, still cant. Please kindly see below.


Thanks in advance again,
Andrew


Hi all,

I have enabled Javascripting in internet explorer 7, and I have been writing script in perl.

The thing I cant do now is to pop up image in small html frame from main html page.... The result of the main html showed blank. Any idea?


Thanks and Best Rgds,
Andrew


a) html script - not sure if the directory perl is correct, put into cgi-bin directory in perl but cant work, so put into d drive...
==============================

Expand|Select|Wrap|Line Numbers
  1.  
  2. <html> 
  3.    <head> 
  4.      <script src="d:testjava-mod.js"> 
  5.      </script>   
  6.  
  7.    </head> 
  8.  
  9.    <body>
  10.    </body>
  11. </html>
  12.  
  13.  

javascript(changed to d drive from perl default script directory still cannot activate script)
========
Expand|Select|Wrap|Line Numbers
  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Java Popup Window Example with size, title and background colour parameters</TITLE>
  5. <script language="JavaScript1.2" type="text/javascript">
  6. <!-- ;
  7. var newwindow;
  8. var wheight = 0, wwidth = 0;
  9.  
  10. function popitup5(url, title, iwidth, iheight, colour) {
  11. var pwidth, pheight;
  12.  
  13. if ( !newwindow || newwindow.closed ) {
  14. pwidth=iwidth+30;
  15. pheight=iheight+30;
  16. newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
  17. wheight=iheight;
  18. wwidth=iwidth;
  19. }
  20.  
  21. if (wheight!=iheight || wwidth!=iwidth ) {
  22. pwidth=iwidth+30;
  23. pheight=iheight+90;
  24. newwindow.resizeTo(pwidth, pheight);
  25. wheight=iheight;
  26. wwidth=iwidth;
  27. }
  28.  
  29. newwindow.document.clear();
  30. newwindow.focus();
  31. newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
  32. newwindow.document.writeln('<img src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" >');
  33. newwindow.document.writeln('<\/center> <\/body> <\/html>');
  34. newwindow.document.close();
  35. newwindow.focus();
  36. }
  37.  
  38. // Routines to tidy up popup windows when page is left
  39. // Call with an onUnload="tidy5()" in body tag
  40.  
  41. function tidy5() {
  42. if (newwindow && !newwindow.closed) { newwindow.close(); }
  43. }
  44.  
  45. // Based on JavaScript provided by Peter Curtis at www.pcurtis.com -->
  46. </script>
  47.  
  48.  
  49. </HEAD> 
  50.  
  51. <BODY onUnload="tidy5()" > 
  52.  
  53. <A HREF="javascript:popitup5('d:0002.jpg','Temple of Heavenly Bliss', 384, 288,'white')"><IMG SRC="d:0002.jpg" WIDTH="160" BORDER="0" HEIGHT="120" HSPACE="10" VSPACE="5" ALT="Temple of Heavenly Bliss" TITLE="Temple of Heavenly Bliss" ALIGN=left></A> 
  54.  
  55. </BODY>
  56. </HTML>
Nov 4 '08 #6
KevinADC
Expert 2GB
This is getting more like tech support and a lot less like helping you with perl questions.
Nov 4 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

23 posts views Thread by Erik Schulp | last post: by
24 posts views Thread by TC | last post: by
1 post views Thread by alokw | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.