Results 1 to 9 of 9

Thread: Ultimate Fade-in slideshow - add an onClick event to an image link

  1. #1
    Join Date
    Feb 2006
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Ultimate Fade-in slideshow - add an onClick event to an image link

    Regarding the link and link target for individual images:

    I am trying to add a onClick event to one of the image links. The onClick event looks like:

    onClick="NewWindow(this.href,'name','500','400','yes');return false"

    Any ideas?

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Feb 2006
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Ultimate Fade-in slideshow

    Oops.... The link to the Ultimate Fade-in slideshow is:
    http://www.dynamicdrive.com/dynamici...nslideshow.htm

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Well, the easiest way to do it is to use the javascript: pseudo-URL scheme. However, this isn't very friendly to non-JS browsers.
    Try changing this:
    Code:
    if (this.theimages[picindex][1]!="") //if associated link exists for image
    slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
    to this:
    Code:
    if (this.theimages[picindex][1]!="") //if associated link exists for image
    slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'" onclick="' + this.theimages[picindex][3] + '">'
    That will allow you to add an onclick event into the array after the target.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Feb 2006
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks Twey,

    I modified the script as stated - Great so far!

    Now this is how stupid I am - Is there any way you can help me with the proper syntax to add the onclick event into the array after the target. The onClick event I am trying to add is as follows:

    onClick="NewWindow(this.href,'name','500','400','yes');return false"

    Thanks Bill

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    For example:
    Code:
    fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new", "NewWindow(this.href,'name','500','400','yes');"]
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Feb 2006
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks-a-million Twey,

    Works Great! Could not have done it without your help

    Bill

  8. #8
    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

    Quote Originally Posted by Twey
    Well, the easiest way to do it is to use the javascript: pseudo-URL scheme. However, this isn't very friendly to non-JS browsers.
    Huh? Without javascript, there would be no link to begin with.
    - John
    ________________________

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

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by John
    Without javascript, there would be no link to begin with.
    D'oh.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh 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
  •