Results 1 to 5 of 5

Thread: Fade slide show not working in IE

  1. #1
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Fade slide show not working in IE

    1) Script Title: Slide fade show not working in IE

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

    3) Describe problem: I want the first one only.
    My code.
    PHP Code:
    <html>
    <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script type="text/javascript" src="fadeslideshow.js">
    <script type="text/javascript">
    var mygallery=new fadeSlideShow({
        wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
        dimensions: [420, 223], //width/height of gallery in pixels. Should reflect dimensions of largest image

            <?php
            
    include "config.php";

            
    $qrry mysql_query("select * from `ban_images` where page ='About Us-Right' ") or die (mysql_error());

            
    ?>

        imagearray: [
        <?php while($row mysql_fetch_array($qrry)) {?>
        
            ["banner/<?php echo $row['image']; ?>", "", "", ""],<?php ?>

        ],
        displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
        persist: false, //remember last viewed slide and recall within same session?
        fadeduration: 500, //transition duration (milliseconds)
        descreveal: "ondemand",
        togglerid: ""
    } )
    </script>
    </head>
    <body>
    <div id="fadeshow1"></div>
    </body>
    </html>
    Thanks
    Last edited by jscheuer1; 03-13-2012 at 07:48 AM. Reason: Format

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

    Do I have this right, do you only want one image? That would mean that it would fade in as the page loads and that's it. After that it would just sit there like any other ordinary image.

    If that's what you want, and the code you have is working to produce a working slideshow, this (barring any typos or misunderstanding of PHP on my part) should take care of it:

    PHP Code:
    <html>
    <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script type="text/javascript" src="fadeslideshow.js">
    <script type="text/javascript">
    var mygallery=new fadeSlideShow({
        wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
        dimensions: [420, 223], //width/height of gallery in pixels. Should reflect dimensions of largest image

            <?php
            
    include "config.php";

            
    $qrry mysql_query("select * from `ban_images` where page ='About Us-Right' ") or die (mysql_error());
            
    $count 0;
            
    ?>

        imagearray: [
        <?php while($count++ < and $row mysql_fetch_array($qrry)) {?>
        
            ["banner/<?php echo $row['image']; ?>", "", "", ""]

        <?php ?>
        ],
        displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
        persist: false, //remember last viewed slide and recall within same session?
        fadeduration: 500, //transition duration (milliseconds)
        descreveal: "ondemand",
        togglerid: "",
        onslide: function(){this.setting.displaymode.type = 'manual';}
    } )
    </script>
    </head>
    <body>
    <div id="fadeshow1"></div>
    </body>
    </html>
    Notes: The script code has also been changed at the end. I tried setting it to manual, but that made an error, so I set it to manual after the first slide. No error. The effect is the same. It stops after the first one. We could have it continue on sliding, but with only one image, what's the point?

    Don't miss the added comma after the togglerid value.

    Also, since there's only one image and there is no comma allowed after the last entry in the image array (only affects IE less than 9 or all IE when the page is in quirks mode), I removed the comma.

    Which then gives me the idea that you might only want the one slideshow and you're having trouble getting it to display in IE because you're adding a comma after every entry in the javascript image array. If that's the case, with the same proviso (it was working in other browsers, that I didn't make a typo, etc.), then this should do the trick:

    PHP Code:
    <html>
    <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script type="text/javascript" src="fadeslideshow.js">
    <script type="text/javascript">
    var mygallery=new fadeSlideShow({
        wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
        dimensions: [420, 223], //width/height of gallery in pixels. Should reflect dimensions of largest image
        <?php
            
    include "config.php";

            
    $qrry mysql_query("select * from `ban_images` where page ='About Us-Right' ") or die (mysql_error());
        
    ?>
        imagearray: [
        <?php while($row mysql_fetch_array($qrry)) {
        
            
    $images[] = "\t\t" '["banner/' $row['image'] . '", "", "", ""]';

        }
        echo 
    implode(",\n"$images);?>
        ],
        displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
        persist: false, //remember last viewed slide and recall within same session?
        fadeduration: 500, //transition duration (milliseconds)
        descreveal: "ondemand",
        togglerid: ""
    } )
    </script>
    </head>
    <body>
    <div id="fadeshow1"></div>
    </body>
    </html>
    Last edited by jscheuer1; 03-14-2012 at 08:16 AM. Reason: add - Which then gives . . . later fix typos in second demo
    - John
    ________________________

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

  3. #3
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the reply.I want many images to slide.I tried the first slide show in the mentioned link. I got it but some pages it is not working.I think it is due to mysql query problem.

    PHP Code:
    <script type="text/javascript">
    var mygallery=new fadeSlideShow({
        wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
        dimensions: [420, 223], //width/height of gallery in pixels. Should reflect dimensions of largest image
          <?php
            
    include "config.php";
            
    $qrry mysql_query("select * from `ban_images` where page ='About Us-Right' ") or die (mysql_error());
            
    ?>
        imagearray: [
        <?php 
        $flag 
    true;
        while(
    $row mysql_fetch_array($qrry)) {
        if(
    $flag){
         
    $strImage '["banner/'.$row['image'].'", "", "", ""]';
          
    $flag false;
          continue;
        }
        
    ?>
            ["banner/<?php echo $row['image']; ?>", "", "", ""],
            <?php 
            
    echo $strImage;
             } 
    ?>
        ],
        displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
        persist: false, //remember last viewed slide and recall within same session?
        fadeduration: 500, //transition duration (milliseconds)
        descreveal: "ondemand",
        togglerid: ""
    })
    </script>
    Above code is working . but when we change the query ,mysql_query("select * from `ban_images` where page ='Home-Right' ") or die (mysql_error()); it will not work.

    Thanks
    Last edited by jscheuer1; 03-13-2012 at 03:55 PM. Reason: Format

  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

    Did you try my second method? It should show all the images.
    - John
    ________________________

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

  5. #5
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yah,I got it sir ..Thanks

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
  •