Categories > TinyButStrong general >

Pop-up window and return from image in a Block

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: TREVOR
Date: 2007-02-11
Time: 10:49

Pop-up window and return from image in a Block

There seem to be quite a few ways to do a pop-up - both with and without Javascript and I am confused.

TBS allows me to display my products on the screen in rows of 5 across. I now need to be able to click on a product image to pop-up a window showing a different image (such as "IMAGE2" from another column in my database) that gives the different colours/styles available for the product. I want to return back where I started when the pop-up is closed.

My block html is
    <td align="center" valign="top" id="[blk_2.STOCK_CODE]" >
    <img src=../images/[blk_2.IMAGE]><br />
    [blk_2.DESCRIPTION;block=td]<br />
    [blk_2.STOCK_CODE]&nbsp;&nbsp;&nbsp;[blk_2.SALES_PRICE;frm='£000.00']<br/>
    <a href="http://ww9.aitsafe.com/cf/add.cfm?userid=B059001&amp;product=[blk_2.STOCK_CODE]++[blk_2.DESCRIPTION]&amp;price=[blk_2.SALES_PRICE]&amp;units=[blk_2.UNITS]&amp;qty=[blk_2.QTY]&amp;return=http://ccgi.handsel.plus.com//fash0107/ank-chrm/f_ank-chrm.php%23[blk_2.STOCK_CODE]">
        <img border="0" id="img[blk_2.STOCK_CODE]" src="../buttonB1.jpg" height="15" width="50" alt="BUY ME" onmouseover="FP_swapImg(1,0,/*id*/'img[blk_2.STOCK_CODE]',/*url*/'../buttonB2.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img[blk_2.STOCK_CODE]',/*url*/'../buttonB1.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img[blk_2.STOCK_CODE]',/*url*/'../buttonB3.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img[blk_2.STOCK_CODE]',/*url*/'../buttonB2.jpg')" style="fp-btn: Soft Capsule 1; fp-proportional: 0; fp-orig: 0" title="BUY ME"></a>   
    </td> 
I do not have enough coding experience to know what would work in this situation. Please will you advise.

Best wishes....Trevor
By: Keith Silav
Date: 2007-02-12
Time: 04:57

Re: Pop-up window and return from image in a Block

I am certainly no expert, but I think you will need to use Javascript. Javascript allows you  to omit toolbars and open the window of a specific size. Javascript will also allow you to automatically navigate back to your original window after the pop-up window is closed. Take a look at this article:

http://accessify.com/features/tutorials/the-perfect-popup/

Good Luck, Keith Silva
By: sheepy
Date: 2007-02-13
Time: 03:33

Re: Pop-up window and return from image in a Block

You can start by adding 'target="_new"' to <a>, so that they opens in new windows.  Or you can replace it with javascript for more control, but beware of popup blockers.  All modern browsers come with one enabled, and almost all older browsers has one installed by vendor, repairman or user.