Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pop-up window navigation

Status
Not open for further replies.

Nesscafe

Programmer
Aug 1, 2006
19
RO
hello!
i have a littel problem that i dont know how or if it's posible..
first i have a site with a thumb galeri and on mouse click i have a javascript to open a pop-up window with that picture.. no problem there, but what i wanna know is after i open a pop-up window with a picture, can i make a buttons to navigate from that picture to the rest of them without closing the pop-up window? any help whould be great..
thx for the time
 
yes, the onclick can call a routine which checks if the window is open, if so then just update the source of the image with the correct image instead of closing and opening all the time.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
<a href="javascript:popUpPortrait('../images/parada-militara/mari/defilare/parada-militara-001.jpg')"><img src="../images/parada-militara/thumbs/defilare/parada-militara-001.jpg" border="0"></a> " this is the code to open the pop-up window... this code was made by a friend, because i dont know much javascript
 
we also need to see the javascript function "popUpPortrait"

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
ups... sorry about that


function popUpLand(URL) {

day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+540+',height='+370);");
}


function popUpPortrait(URL) {

day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+390+',height='+550);");
}

function nextLink() {
var i = "parada-militara-036.jpg";
document.write();
}
 
ehhh.

there are a couple of ways to handle this. you are opening an image file in a new window, rather than opening an HTML page. therefore, you'll need to either a) modify your existing popup function to write actual HTML to the window, at which point you should be able to write HTML links to browse different images or b) handle this dynamically, using server-side script.

are you using any server-side scripting languages? ASP? PHP? ColdFusion?



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
i'm using PHP, and i prefere not to use HTML pages.. because there's a lot of pictures in that page and that would mean a lot of boring work
 
Nesscafe, if your desire is to write HTML "next" and "previous" buttons, what other method, other than HTML, do you want to utilize?

take a look at this slideshow I recently set up. if it's something you're interested in, I'll share the code.

it basically reads an image directory and dynamically displays the image and the links to other images.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
actualy i dont need a slideshow in html.. i need buttons for navigation in a pop-up window
 
cLFlaVA said:
actually, i won't share the code. sorry.
And there's me thinking it was a womens perogative to change their mind!


nesscafe : your mate has specifically written this to always open a new window look
Code:
function popUpPortrait(URL) {

day = new Date();
[b]id = day.getTime();[/b]
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+390+',height='+550);");
}

they are creating a window object which is unique based on the time, so will always open a new window.

so if you change the code to this...
Code:
<script>
function popUpPortrait(URL) {

    if(!window.popwin){
        mypopwin = window.open(URL, 'popwin', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+390+',height='+550);
    }
    else{
        window.popwin.location.href = URL;
    }
    
    mypopwin.focus();
}
</script>
this should do the trick






"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top