PDA

View Full Version : is that possible ?


siLent`skY
04-27-2006, 08:50 PM
i have a problem. i have a flash gallery and every picture link calls a JS popup

on (release) {
getURL("javascript:popup('/11095.jpg','')");
}

my JS in the html is

<script language="JavaScript">
function popup(URL, Name, Features)
{
newWindow=window.open(URL, Name,"height=600,width=350");
newWindow.focus();
newWindow.document.bgColor="000000";

}

</script>

i want to ask is there a way to put a buton in the popup window
but i am loading *.jpg in the popup, not html. my question is can i add that close button in the popup window function, so every time i call that function that button to appear under the *.jpg im loading

pls if there is a way to do that rewrite my code with my ".../close.gif" im kinda newbie with js and html

Ruben
05-13-2006, 07:52 PM
Yes, it is possible; however it's no piece of cake. I gotta go right now, but tomorrow I'll tell you how (it's no quick answer).

:) - Ruben

Ruben
05-14-2006, 01:13 PM
...Alrighty, I was gonna explain how to manipulate server-requests with htaccess (http://httpd.apache.org/docs/1.3/howto/htaccess.html) and the rewrite-module (http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html) (a.k.a. mod_rewrite).

Fortunately though, in the process of writing everything down I thought of a much easier way which requires just a little extra javascript in your excisting function, here it goes:
function popup(URL, Name, Features){
newWindow=window.open('', Name,"height=600,width=350");
newWindow.document.write("<img src='" + URL + "'><br><input type='button' onclick='window.close();' value='close me'>");
newWindow.focus();
newWindow.document.bgColor="000000";
}

That should cut it.. All we really did was opening an empty document (instead of the image itself, in the empty document we wrote the img-tag and a form-button..

..tell me if it worked out or not.


:) - Ruben