<?php the_ID(); ?>, javascript and the loop
-
Hello Community!
I would use the moo-tools slider effect in my loop.
In header.php
<script type="text/javascript"> window.onload = function() { var topbar = document.getElementById('newsbox'); topbar.style.height = 20 + "px"; } </script>
in my loop:
<?php $my_query = new WP_Query('category_name=news&showposts=3'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <div id="newsbox" onmouseover="scale_<?php the_ID(); ?>.sizeup()" onmouseout="scale_<?php the_ID(); ?>.sizedown(20)"> <div class="content"> <script type="text/javascript">scale_<?php the_ID(); ?> = new fx.Scaleheader('newsbox', {duration: 300}); </script> CONTENT </div></div> <?php endwhile; ?>
THIS WILL WORK FINE: with Firefox.
But it wont work with Safari and Opera. These both will only slide up the first entry.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘<?php the_ID(); ?>, javascript and the loop’ is closed to new replies.