Results 1 to 4 of 4

Thread: second OnClick issues with CMotion

  1. #1
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default second OnClick issues with CMotion

    CMotion Image Gallery

    http://www.dynamicdrive.com/dynamici...iongallery.htm

    I am trying to add a second behavior to the thumbs in the motiongallery (ideally a second onClick so as to swap 2 images in 2 different layers).
    The idea is that when someone clicks a specific thumb with one click, this swaps 2 other images.
    This however, results in suceeding in swapping the 2 images, but the motiongallery has no motion whatsoever.

    Example (added onClick in Red):
    <nobr id="trueContainer"><img src="thumb_minute.gif" onClick="MM_swapImage('flybath','','minute.gif',0);MM_swapImage('strip1','','strip2.gif',1)">
    <img src="thumb_caged.gif" onClick="MM_swapImage('flybath','','caged.gif',0)">
    <img src="thumb_sinking.gif" onClick="MM_swapImage('flybath','','flybath.gif',0)">
    <img src="thumb_harmony.gif" onClick="MM_swapImage('flybath','','harmony.gif',0)"></nobr>

    The text in red is the only thing that has changed. The motiongallery was working perfectly prior to this addition.
    Last edited by nathanimate; 02-26-2012 at 11:19 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,030
    Thanks
    44
    Thanked 3,211 Times in 3,173 Posts
    Blog Entries
    12

    Default

    Please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

  3. #3
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Please click on first thumbnail in the motiongalleries below.
    working
    not working
    Last edited by nathanimate; 02-26-2012 at 11:19 AM.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,030
    Thanks
    44
    Thanked 3,211 Times in 3,173 Posts
    Blog Entries
    12

    Default

    The problem has nothing to do with the second call to MM_swapImage() and in fact this is not the only difference between the two pages. Aside from the fact that they each employ a different version of MM_swapImage(), the non-working example also uses a body onload attribute. The differences in version of MM_swapImage() are not a problem. This body onload attribute is. It effectively overwrites the CMotion Gallery's window.onload event.

    To restore it change:

    Code:
    <body link="#999999" vlink="#999999" alink="#999999" onload="MM_preloadImages('strip2.gif')">
    to (addition highlighted):

    Code:
    <body link="#999999" vlink="#999999" alink="#999999" onload="fillup(); MM_preloadImages('strip2.gif')">
    - John
    ________________________

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

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

    nathanimate (03-01-2012)

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
  •