Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Ultimate Fade-in slideshow (v1.51) / starting script with setTimeout

  1. #1
    Join Date
    Aug 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ultimate Fade-in slideshow (v1.51) / starting script with setTimeout

    1) Script Title: Ultimate Fade-in slideshow (v1.51)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem: Hallo, i have following question:
    excuse my english, but i´m german

    The script is normally starting when the page is loaded.
    My problem is, that i want to start it with a function-call like this...

    function startfade() {
    new fadeshow(fadeimages, 375, 265, 0, 2000, 1)
    }

    but it dont work. i get an error.

    do someone can help me how i can start the script with a function-call?

    thank you for help...

    greets ron


    p.s. the headline is not really right. i dont need a setTimeout, i just need a function-call...
    Last edited by rooon; 08-27-2007 at 10:35 AM. Reason: the headline is not reaaly right...

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

    Default

    I'm afraid the script uses document.write(): there's no way you can initialise it after the page has loaded.
    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
    Aug 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I cant believe that there is no way to to initialise the script over a function-call.
    I hope there is someone who know how to do this...

    greets ron in hope....

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

    This script allows you to start the slide show stopped, and its buttons can then start it:

    http://www.dynamicdrive.com/dynamici...army/index.htm
    - John
    ________________________

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

  5. #5
    Join Date
    Aug 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you for your answer...
    i tried this befor i wrote my question here.
    but i didnt get it to work.

    i dont want see buttons on my page.
    and i tried to konfigure the script with no buttons and no automatic start, but it doesnt work.

    it doesnt matter if i use this script or the army-script.
    so, if someone have a solution for my problem with the army-script, i would be happy.

    i hope for more answers....

    Greets ron

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

    Default

    Code:
    <div style="display: none;">
      <!-- Buttons here -->
    </div>
    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
    Aug 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Twey,

    <div style="display: none;">
    <!-- Buttons here -->
    </div>

    o.k. thats an idee.
    first i have to search where javascript implementate this code, but this shouldnt be a problem.
    but how do i call the function to start fading?

    when i look at the source-code i can see this:

    <input id="gostp0" value=" Play " onclick="iss[0].gostop(this);"

    but how i call it for example from the end of a function?
    i have a problem with "this" because from somewhere else "this" doesnt work.

    Greets ron

  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

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
    
    //If using image buttons as controls, Set image buttons' image preload here true
    //(use false for no preloading and for when using no image buttons as controls):
    var preload_ctrl_images=false;
    
    var slides=[]; //FIRST SLIDESHOW
    //configure the below images and descriptions to your own. 
    slides[0] = ["photo1.jpg", "Kissing Fools", "http://www.dynamicdrive.com"];
    slides[1] = ["photo2.jpg", "Seated Woman"];
    slides[2] = ["photo3.jpg", "The Dog Lovers"];
    slides[3] = ["photo4.jpg", "Standing Woman"];
    slides[4] = ["photo5.jpg", "John, Mary and Jesus"];
    //optional properties for these images:
    slides.no_auto=1; //use to make show completely user operated (no play button, starts in stopped mode)
    slides.no_descriptions=1; //use for no descriptions displayed
    slides.no_controls=1; //will set a slide show with no controls
    slides.no_added_linebreaks=1; //use for no added line breaks in formatting of texts and controls
    slides.pause=1; //use for pause onmouseover
    slides.use_title=1; //use for descriptions as images title attributes
    
    </script>
    
    <script src="swissarmy.js" type="text/javascript">
    
    /***********************************************
    * Swiss Army Image slide show script  - &#169; John Davenport Scheuer: http://home.comcast.net/~jscheuer1/
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full original source code
    ***********************************************/
    
    </script>
    </head>
    <body>
    <div style="width:140px;">
    Some content
    <script type="text/javascript">
    //Notes on Parameters: The only required parameter is the slides_array_name.  If Width is used, so must Height.
    //Interval is optional too.  It is always last, either fourth after Width and Height or second after Slides_array_name.
    //Usage: new inter_slide(Slides_array_name, Width, Height, Interval)
    new inter_slide(slides)
    setTimeout(function(){iss[0].gostop();}, 15000);
    </script>
    Some other content
    </div>
    </body>
    </html>
    - John
    ________________________

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

  9. #9
    Join Date
    Aug 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi jscheuer1,

    thank you for the trouble you have taken.
    but i'm sorry to say that your solution isn´t working.

    the first picture is directly fading when the page is loaded.
    and then there is no further fading.

    i get following errors:

    - directly when the page loaded:

    1.
    Warning: variable el hides argument
    Source file: swissarmy.js
    Line: 238, Column: 4
    Source Code:
    var el=el? el : this.imgel;

    2.
    Warning: reference to undefined property this.fadeclear
    Source file: swissarmy.js
    Zeile: 342


    and after the 15 sec. which are adjusted :

    3.
    Warning: reference to undefined property this.inprocess
    Source file: swissarmy.js
    Line: 265

    But i need that the first picture is fading in after the adjusted time.
    before there should be shown no picture.

    It's a pity that your solution isn´t working.
    i think that it is what i need.
    perhaps you know how to fix the error?

    Greets ron

  10. #10
    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 rooon View Post
    your solution isn´t working.
    i think that it is what i need.
    perhaps you know how to fix the error? ;)
    Works here in IE 7, FF 2, Safari 3, and Opera 9. No errors.

    Please Supply a link to your Problem Page.

    To get it to show nothing onload, make the first image transparent and leave off your last image in the array:

    Code:
    var slides=[]; //FIRST SLIDESHOW
    //configure the below images and descriptions to your own. 
    slides[0] = ["spacer.gif", "John, Mary and Jesus"]; //this will be replaced by the last image
    slides[1] = ["photo1.jpg", "Kissing Fools", "http://www.dynamicdrive.com"];
    slides[2] = ["photo2.jpg", "Seated Woman"];
    slides[3] = ["photo3.jpg", "The Dog Lovers"];
    slides[4] = ["photo4.jpg", "Standing Woman"];
    //last image missing
    Then in the body call:

    Code:
    <script type="text/javascript">
    //Notes on Parameters: The only required parameter is the slides_array_name.  If Width is used, so must Height.
    //Interval is optional too.  It is always last, either fourth after Width and Height or second after Slides_array_name.
    //Usage: new inter_slide(Slides_array_name, Width, Height, Interval)
    new inter_slide(slides, 140, 225)
    function runit(){
    iss[0].gostop();
    setTimeout(function(){iss[0].imgs[0][0]="photo5.jpg";}, 3000)
    }
    setTimeout(function(){runit()}, 5000);
    </script>
    The red image is the real last image.

    Added Later:

    I'm curious what browser was giving you all these problems?

    I was just looking over those 'errors' of yours, just to see if any of them made any sense. They do, but they are not errors. They are warnings. And, as I said, the script works with no errors or warnings in the browsers mentioned. You must be using a javascript debugger or something. Those are valid warnings. But since the 'hidden' argument is used by the variable that hides it, that's no problem. The undefined property is just that. Properties don't need to be defined in javascript unless a value or method is being used from them. That particular one gets defined in time for it to be of use when needed, just not in time for it not to be undefined as the script starts. It stores a reference to the fading process, once underway.
    Last edited by jscheuer1; 08-28-2007 at 09:56 AM. Reason: Add Info
    - John
    ________________________

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

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
  •