Forums » Customize

automatic slideshow / iwakami

gartenstuhl
GERMANY
2009-08-07 13:22:45
Permalink Post
 

is there a way to trigger the iwakami slideshow automatically?
like: setTimeout(\"show_image($next)\", 10000); in dynamicJS().
But how will I get the $next var into the javascript?!

Vaska A
UNITED STATES
2009-08-07 13:27:57
Permalink Post
 

Yeah, that's the right path. And then you would need to add a settimeout that would be self referential and keep you running through the loop.

You would probably need to add to as a $(document).ready use (look it up at Jquery.com) to get it rolling.

gartenstuhl
GERMANY
2009-08-07 18:39:29
Permalink Post
 

thanks.

I came up with something like this now in dynamicJS()
I get the amount of pics with get_total() and increase the id starting 1 till total and start with 1 again.

But the fade looks kind of ugly. I want the previous pic to fadeout like fadeOut(3000) and the new one with 3000 fadeIn too. But it shows all pics at the time and fades them all out...

var total = ".get_total().";
    var counter= 2;
    
    function show_image(id)
    {    
        $('.pic').hide();
        $('#p' + id).fadeIn('slow');
        $('#num').html(id);
        return false;
    }
    
    function start_slide(){
        if(counter > total){
        counter = 1;
        }
    show_image(counter);
    counter++;
    }
    
    window.setInterval('start_slide()', 9000);

Vaska A
UNITED STATES
2009-08-07 21:06:37
Permalink Post
 

It works? That's great! I'm sure folks will be interested in that one...

;)

beside
SWITZERLAND
2009-09-05 20:15:52
Permalink Post
 

Here is the solution that works:

  1. Don't change
  2. function dynamicJS()
  1. add:
  2. $s .= "<script type='text/javascript'>n";
  3. $s .= "var total = $total;n";
  4. $s .= "var counter= 2;n";
  5. $s .= "function start_slide(){n";
  6. $s .= "if(counter > total){n";
  7. $s .= "counter = 1;n";
  8. $s .= "}n";
  9. $s .= "show_image(counter);n";
  10. $s .= "counter++;n";
  11. $s .= "}n";
  12. $s .= "n";
  13. $s .= "window.setInterval('start_slide()', 5000);n";
  14. $s .= "</script>n"; 

after:

  1. // images
  2. $s .= "<div id='img-container'>n";
  1. in:
  2. function createExhibit()
paucc A
SPAIN
2009-09-05 21:59:01
Permalink Post
 

That sounds interesting!

dudesek
SWITZERLAND
2009-09-24 13:41:28
Permalink Post
 

beside. I tried your code in a plugin I named "exhibit.slideshow_auto.php" but it just rendered a "n" and nothing happend:
http://dudesek.ch/index.php?/unfassbar/kolotoc/
could you say why?
no probs with original slideshow plugin..

dudesek
SWITZERLAND
2009-09-29 15:49:17
Permalink Post
 

sorry that was of course the wrong plugin I edited...

jaz
CANADA
2009-12-02 22:31:50
Permalink Post
 

dudesek, beside

I am having the same trouble as dudesek.

I put the (code) solution from beside into the iwakami plugin, exactly where instructed.

Nothing changed. An "n" appeared above the image and no fading occurs.

Any ideas as to what I could be doing incorrectly?!

Thanks!

mendel1
GERMANY
2010-01-08 14:57:45
Permalink Post
 

Hey!

I really like this idea. Did anyone manage to make this work? I've been trying out some stuff, but nothing seems to work.

I t would be really nice if someone has a clue or a working alternative.
Thanks!

puppiepoppy
CHINA
2010-01-08 18:00:11
Permalink Post
 

Hi gartenstuhl,

May I know your website url? Would love to see what you've done.

Mike

Spag
GERMANY
2010-02-19 16:55:52
Permalink Post
 

To use what Beside posted, just add a back-slash "\" before the "n" at the end of every line...

farwest1
UNITED STATES
2010-02-25 17:05:52
Permalink Post
 

I just let out a silent shout of absolute joy when I got Beside's modification to work!

Opening page automatic slideshow is running! Beautiful!

lemathieu A
FRANCE
2010-02-25 17:50:06
Permalink Post
 

Mike, please for last time, do not post your link everywhere…

.

Thank you.

rickykappa A
ITALY
2010-02-25 17:50:55
Permalink Post
 

nice feature, and it works also with Slideshow/Thumbnail power combo, or at least with FF in my test page.
there is actually a little bit of mess if you play with prev/next arrows, probably a counter conflict.
but, next step, any idea on how to make a start/stop onclick?

farwest1
UNITED STATES
2010-02-25 18:00:44
Permalink Post
 

Sorry, lemathieu, who is Mike?

rickykappa A
ITALY
2010-02-25 18:04:16
Permalink Post
 

search box with his nickname, you'll surely get a link
;-)

cooper
UK
2010-04-06 19:00:59
Permalink Post
 

i got besides edit to work with the automatic slideshow, thanks! but can't get any sort of fade working....anyone managed?

cooper
UK
2010-04-06 19:03:03
Permalink Post
 

and also can't figure out how to get rid of the counter now i dont need it....any tips?

would be much appreciated

ntlk
UNITED KINGDOM
2010-05-19 22:18:20
Permalink Post
 

To get rid of the counter:

  1. In the line that says:
  2. $s .= "<p id='nums'><span id='num'>1</span>/$total</p>";

add two slashes at the start of the line, like so:

  1. //$s .= "<p id='nums'><span id='num'>1</span>/$total</p>";

I tried to add fade to it, with no luck so far.

michellehuang
BRAZIL
2010-09-03 17:58:31
Permalink Post
 

Hi,
I'm having problems with inserting the initial code.

should

  1. var total = ".get_total().";
  2.     var counter= 2;

be inserted straight before

  1. function show_image(id)
  2. ?

Because it's giving me errors

my website is: www.michellehuang.com

I've been tweaking around with the code but I can't seem to find a defect.

Thanks in advance ;-)

michelle

michellehuang
BRAZIL
2010-09-03 17:59:04
Permalink Post
 

ps: I'm using under "Iwakami teste"

michellehuang
BRAZIL
2010-09-03 22:29:24
Permalink Post
 

this is how my script is atm

  1. <?php if defined'SITE' exit'No direct script access allowed'

/**
* Iwakami
*
* Exhibition format
*
* @version 1
* @author Vaska
*/

// defaults from the general libary - be sure these are installed
$exhibit['dyn_css'] = dynamicCSS();
$exhibit['dyn_js'] = dynamicJS();
$exhibit['exhibit'] = createExhibit();

function dynamicJS(){
var total = ".get_total().";
    var counter= 2;

    function show_image(id)
    {
        $('.pic').hide();
        $('#p' + id).fadeIn('slow');
        $('#num').html(id);
        return false;
    }

function start_slide(){
    if(counter > total)    {
        counter = 1;
    }
    show_image(counter);
    counter++;
}

window.setInterval('start_slide()', 5000);

    
function createExhibit()
{
    $OBJ =& get_instance();
    global $rs;
    
    $pages = $OBJ->db->fetchArray("SELECT *
        FROM ".PX."media, ".PX."objects_prefs
        WHERE media_ref_id = '$rs[id]'
        AND obj_ref_type = 'exhibit'
        AND obj_ref_type = media_obj_type
        ORDER BY media_order ASC, media_id ASC");

        
    // ** DON'T FORGET THE TEXT ** //
    $s = $rs['content'];

    if (!$pages) return $s;
    
    $i = 1; $a = '';
    
    $total = count($pages);
    
    // people will probably want to customize this up
    foreach ($pages as $go)
    {
     $title         = ($go['media_title'] == '') ? '' : $go['media_title'] . ' ';
     $caption     = ($go['media_caption'] == '') ? ' ' : $go['media_caption'];

        $x = getimagesize(BASEURL . GIMGS . '/' . $go['media_file']);
        
        $off = ($i == 1) ? "style='display: block;'" : "style='display: none;'";
        
        $next = ($i == $total) ? 1 : $i+1;
        
        $a .= "\n

{$title}
{$caption}

\n";
        
        $i++;
    }
    
    // images
    $s .= "\n";
    $s .= "\n";
    $s .= "var total = $total;\n";
    $s .= "var counter= 2;\n";
    $s .= "function start_slide(){\n";
    $s .= "if(counter > total){\n";
    $s .= "counter = 1;\n";
    $s .= "}\n";
    $s .= "show_image(counter);\n";
    $s .= "counter++;\n";
    $s .= "}\n";
    $s .= "\n";
    $s .= "window.setInterval('start_slide()', 5000);\n";
    $s .= "\n";
    //$s .= "

1/$total

";
    $s .= "\n";
    $s .= $a;
    $s .= "\n";
    $s .= "\n\n";
        
    return $s;
}

function dynamicCSS()
{
    return "#img-container { }
#pics { }
p#nums { }
.img-bot { margin-bottom: 12px; }";
}

?>

michellehuang
BRAZIL
2010-09-04 13:24:01
Permalink Post
 

nevermind just follow Beside's instructions and all will be ok... darn darn darn!!

martin_kohout
CZECH REPUBLIC
2011-01-15 14:21:12
Permalink Post
 

hello!

i read the whole thread and followed the instructions by Beside but unfortunately, what i get is Slideshow the same as before.

I tried to set the total property to a number manually but that doesn't change it. The code looks identical to the one in the post but my main concern is that the code that appears in the page is missing the $total in the 3rd line of the example. Is that supposed to be?

The page where I'm testing it is here.

The modified slideshow is here: http://www.fernandogarciadory.com/ndxz-studio/site/plugin/exhibit.slideshow_autoslide.php

martin_kohout
CZECH REPUBLIC
2011-01-15 14:21:59
Permalink Post
 

I'd be very thankful for any help!

Best,
MK

cristinatorres
SPAIN
2011-02-04 06:28:35
Permalink Post
 

Hello, I have the iwakami plugin installed, it's working good, but the buttons NEXT | PREV are in two different lines, it seems that each one has a 400px margin-left. I've tried everything and I really don't know how to solve this. Can you help me please?

Check the gallery here: http://www.hrsolimar.es
thanks!

cristinatorres
SPAIN
2011-02-04 06:29:42
Permalink Post
 

Hello, I have the iwakami plugin installed, it's working good, but the buttons NEXT | PREV are in two different lines, it seems that each one has a 400px margin-left. I've tried everything and I really don't know how to solve this. Can you help me please?

Check the gallery here:

http://www.hrsolimar.es/index.php?/castellano/galeria-de-imagenes/

Showing 1 - 28 of 28 posts in Forum > Customize > automatic slideshow / iwakami
 

You need to be logged in to post.