Results 1 to 4 of 4

Thread: wanna open a new window

  1. #1
    Join Date
    Jul 2007
    Location
    mumbai india
    Posts
    16
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Question wanna open a new window

    hi all

    my question is about the script present on same site

    Link

    I edit the script as :

    Code:
    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

  2. #2
    Join Date
    Jul 2007
    Location
    mumbai india
    Posts
    16
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    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

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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):

    Code:
    function transport(){
    window.location=photoslink[which]
    }
    Change it to:

    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. The Following User Says Thank You to jscheuer1 For This Useful Post:

    aneeselahi (07-28-2010)

  5. #4
    Join Date
    Jul 2007
    Location
    mumbai india
    Posts
    16
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    oh wow!

    thanks dear moderator!

    thanks a lot

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •