0

http://basic-slider.com/

I want to know how can you determine if an object has slide in the basic slider? I am wanting to pause a video if a slider has occured but do not know how to determine if the slide has happened?

UPDATE:

The code below displays how I display a jwplayer in galleria slider. But issue is that it only displays a black square. No slider or video player appears and I do want to use jwplayer for this:

<?php
                        //start:procedure video

     if(count($arrVideoFile[$key]) > 1){
    ?>

    <style>
        #galleriavideo_<?php echo $key; ?>{ width: 500px; height: 300px; background: #000 }
    </style>

     <div id="galleriavideo_<?php echo $key; ?>">
    <?php
    foreach ($arrVideoFile[$key] as $v) { ?>
    <div id="myElement-<?php echo $key.'-'.$i; ?>">Loading the player...

    <script type="text/javascript">


    jwplayer("myElement-<?php echo $key.'-'.$i; ?>").setup({
        file: "<?php echo 'VideoFiles/'.$v; ?>",
        width: 480,
        height: 270
    });

    <?php $i++; ?>
    </script>

    </div>
    <?php } ?>
    </div>

             <script type="text/javascript">

                Galleria.loadTheme('jquery/classic/galleria.classic.min.js');
                Galleria.run('#galleriavideo_<?php echo $key; ?>');

              </script>

    <?php

            }
user2056342
  • 195
  • 3
  • 15

1 Answers1

1

The slider you chose does not seem to be able to handle events. Maybe you should choose another plugin ? For example Galleria has that possibility. Check Documentation => Events, particularly image.

In case you want to stay with the basic slider, you could change the code to add what you want when a slide is shown. More info here: jQuery event to trigger action when a div is made visible

Another solution would be to use the jQuery Watch plugin and detect when the display attribute changes.

Personally, I think the first solution is the easiest :)

Community
  • 1
  • 1
Andreas Schwarz
  • 1,788
  • 17
  • 42
  • I will go for the first solution but can you just help me by seeing what I have done wrong when try to implement the galleria slider, it keeps say `init failed: Galleria counld not find element 72` element 72 is the `$[key]` in the div. – user2056342 Feb 14 '13 at 17:31
  • You forgot to add a `#` when you run Galleria: the line should be `Galleria.run('#galleriaimage_');` – Andreas Schwarz Feb 14 '13 at 18:12
  • Ok got one more question in my update before I can give you upvote and best answer. It is dealing with trying to display a jwplayer into the galleria slider – user2056342 Feb 14 '13 at 19:29
  • You should create another page with your jwplayer and use it within an iframe. See _Displaying iframes_ here: http://galleria.io/docs/references/data/ – Andreas Schwarz Feb 14 '13 at 20:07
  • If you don't mind can you show a sample code on how to create the ifrmae for the update example, I have been trying but I think I am implementing it incorrectly. I have marked your answer and upvoted but please can you show me a code snippet on how it should be implemented to fit my code? – user2056342 Feb 14 '13 at 21:36
  • I wrote a small example here: http://stackoverflow.com/questions/14883914/having-trouble-using-iframes/14885144#14885144 – Andreas Schwarz Feb 14 '13 at 22:22