Results 1 to 2 of 2

Thread: jQuery Image Warp script

  1. #1
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default jQuery Image Warp script

    1) Script Title: jQuery Image Warp script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/imagewarp.htm

    3) Describe problem: Im using it for some image's which works as link's. Problem is that i would like to use target="_new" on some of the links to be sure users still have my page open while surfing some of the links. But it seems like that command is ignored when using the script.

    Any idea how to fix this somehow?

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    When creating the script I actually tried to have the script support link targets automatically. The problem I ran into is basically with certain pop up blockers such as that built into Google ToolBar. Browsers with that will block the script from opening a new window programmatically using window.open() based on the presence of the "target" attribute.

    If the above is not an issue for you (ie: your page is on an intranet where users all use the same browser), inside the .js file, you'd replace:

    Code:
    				window.location=imageinfo.$link.attr('href')
    with:

    Code:
    				if (imageinfo.$link.attr('target'))
    					window.open(imageinfo.$link.attr('href'), imageinfo.$link.attr('target'))
    				else
    					window.location=imageinfo.$link.attr('href')
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    Puccini (09-09-2009)

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
  •