PDA

View Full Version : wanna open a new window



aneeselahi
07-22-2010, 02:44 PM
hi all

my question is about the script present on same site

Link (http://www.dynamicdrive.com/dynamicindex14/dhtmlslide.htm)

I edit the script as :



var linkornot=1
photoslink[0]="images/1.jpg"
photoslink[1]="images/2.jpg"

I wanna open a new window when click on the image

I have a little bit knowledge of Javascript :(

so please help me

aneeselahi
07-22-2010, 02:47 PM
oh

i saw a thread named "do not dynamic drive related question here"

plz admin
if i am doing wrong so delete my thread

thx

jscheuer1
07-23-2010, 04:19 AM
No big deal, I just moved your thread to the Dynamic Drive Scripts Help section.

To answer your question, you can cause the links to open in a new window like so (find this at the end of the code from Step 1):


function transport(){
window.location=photoslink[which]
}

Change it to:


function transport(){
window.open(photoslink[which], '_blank');
}

If you are at all familiar with, or are willing to learn about the window.open() function, there are many specifications you may make with it. See:

http://www.w3schools.com/jsref/met_win_open.asp

And/or if you have a specific question about it or its specifications, feel free to ask.

But be aware that opening a new window can be blocked by the user's browser.

That's unusual for something like this, but can happen. There are other ways to deal with presenting content to the user in a window-like interface (like Lightbox and other modal scripts) that, though more involved than opening a new window, as long as the user has javascript enabled (which they would need anyway to view the slide show) will not be blocked by the user's browser.

aneeselahi
07-28-2010, 04:23 PM
oh wow!

thanks dear moderator!

thanks a lot

actually since last 5 years I do not touch the JS
only working on php