By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 1,962 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

how pop up another image in the html by clicking certain image

100+
P: 236
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.


Thanks in advance,
Andrew



Expand|Select|Wrap|Line Numbers
  1. <div class="centerBoxContentsNew centeredContent back" style="width:33%;"><a href="01.jpg"><img 
  2.  
  3. src="02.JPG" alt="RHB_CNLIN0003-SILVER" title="" width="60" height="80" style="position:relative" 
  4.  
  5. onmouseover="showtrail('02.jpg','RHB_CNLIN0003-SILVER',60,80,187,249,this,0,0,60,80);" 
  6.  
  7. onmouseout="hidetrail();"  /></a><br /><a href="01.jpg">RHB_CNLIN0003-SILVER</a><br />US$15.00</div>
  8. <br class="clearBoth" />
  9.  
  10.  
Nov 3 '08 #1
Share this Question
Share on Google+
6 Replies


100+
P: 236
Hi All,

I got from the code above error : object expected line : 3 character 1 code 0 from internet explorer 7. There seemed to be problem with the internet explorer although i have did windows update.

Kindly enlighten...


Cheers...
Andrew
Nov 3 '08 #2

acoder
Expert Mod 15k+
P: 16,027
That is a JavaScript error. This does seem to be a JavaScript problem. If you want to avoid JavaScript and use CSS alone, use :hover
Nov 3 '08 #3

100+
P: 236
Hi Sir,

I dont want it to hover, I saw the URL. I just wanted pop out the image without any html background. Thanks.


Thanks and Best Rgds,
Andrew
Nov 3 '08 #4

acoder
Expert Mod 15k+
P: 16,027
It would be easiest with JavaScript, though you could possibly put something together with CSS. Do you want to avoid JavaScript at all costs? If not, I would recommend JavaScript and from the code in your first post, it seems JavaScript is being used anyway.

If you're going to use JavaScript, I'll move this thread to the JavaScript for you.
Nov 3 '08 #5

100+
P: 236
Hi Sir,

I saw this, not sure if got any alternative to use just html? But the web development tool I use is perl.


Thanks,
Andrew
Nov 3 '08 #6

acoder
Expert Mod 15k+
P: 16,027
In that case, JavaScript would be your best bet. Moved thread to the JavaScript forum.

Note that JavaScript, HTML, CSS, etc. are all client-side while Perl is server-side.

To show an image within the browser window by clicking on a certain image, you would need to add some code that is triggered onclick (not onmouseover as you have it in the sample code). You can use an image gallery script if you want. Can you show some more of the code that you have?
Nov 3 '08 #7

Post your reply

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